Merge branch 'master' of https://github.com/vueComponent/ant-design
commit
d13cfa9cc0
@ -0,0 +1,33 @@
|
||||
<cn>
|
||||
#### 基本
|
||||
最简单的用法。
|
||||
</cn>
|
||||
|
||||
<us>
|
||||
#### Basic
|
||||
The basic example.
|
||||
</us>
|
||||
|
||||
```html
|
||||
<template>
|
||||
<a-popconfirm title="Are you sure delete this task?" @confirm="confirm" @cancel="cancel" okText="Yes" cancelText="No">
|
||||
<a href="#">Delete</a>
|
||||
</a-popconfirm>
|
||||
</template>
|
||||
<script>
|
||||
import { message } from 'antd'
|
||||
|
||||
export default {
|
||||
methods: {
|
||||
confirm (e) {
|
||||
console.log(e)
|
||||
message.success('Click on Yes')
|
||||
},
|
||||
cancel (e) {
|
||||
console.log(e)
|
||||
message.error('Click on No')
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
```
|
@ -1,29 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<md>
|
||||
## 基本
|
||||
最简单的用法。
|
||||
</md>
|
||||
<Popconfirm title="Are you sure delete this task?" @confirm="confirm" @cancel="cancel" okText="Yes" cancelText="No">
|
||||
<a href="#">Delete</a>
|
||||
</Popconfirm>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { Popconfirm, Button } from 'antd'
|
||||
export default {
|
||||
methods: {
|
||||
confirm (e) {
|
||||
console.log(e)
|
||||
},
|
||||
cancel (e) {
|
||||
console.log(e)
|
||||
},
|
||||
},
|
||||
components: {
|
||||
Popconfirm,
|
||||
|
||||
},
|
||||
}
|
||||
</script>
|
@ -0,0 +1,134 @@
|
||||
<cn>
|
||||
#### 位置
|
||||
位置有十二个方向。如需箭头指向目标元素中心,可以设置 `arrowPointAtCenter`。
|
||||
</cn>
|
||||
|
||||
<us>
|
||||
#### Placement
|
||||
There are 12 `placement` options available. Use `arrowPointAtCenter` if you want arrow point at the center of target.
|
||||
</us>
|
||||
|
||||
```html
|
||||
<template>
|
||||
<div id="components-a-popconfirm-demo-placement">
|
||||
<div :style="{ marginLeft: `${buttonWidth}px`, whiteSpace: 'nowrap' }">
|
||||
<a-popconfirm placement="topLeft" okText="Yes" cancelText="No" @confirm="confirm">
|
||||
<template slot="title">
|
||||
<p>Are you sure delete this task?</p>
|
||||
<p>Are you sure delete this task?</p>
|
||||
</template>
|
||||
<a-button>TL</a-button>
|
||||
</a-popconfirm>
|
||||
<a-popconfirm placement="top" okText="Yes" cancelText="No" @confirm="confirm">
|
||||
<template slot="title">
|
||||
<p>Are you sure delete this task?</p>
|
||||
<p>Are you sure delete this task?</p>
|
||||
</template>
|
||||
<a-button>Top</a-button>
|
||||
</a-popconfirm>
|
||||
<a-popconfirm placement="topRight" okText="Yes" cancelText="No" @confirm="confirm">
|
||||
<template slot="title">
|
||||
<p>Are you sure delete this task?</p>
|
||||
<p>Are you sure delete this task?</p>
|
||||
</template>
|
||||
<a-button>TR</a-button>
|
||||
</a-popconfirm>
|
||||
</div>
|
||||
<div :style="{ width: `${buttonWidth}px`, float: 'left' }">
|
||||
<a-popconfirm placement="leftTop" okText="Yes" cancelText="No" @confirm="confirm">
|
||||
<template slot="title">
|
||||
<p>Are you sure delete this task?</p>
|
||||
<p>Are you sure delete this task?</p>
|
||||
</template>
|
||||
<a-button>LT</a-button>
|
||||
</a-popconfirm>
|
||||
<a-popconfirm placement="left" okText="Yes" cancelText="No" @confirm="confirm">
|
||||
<template slot="title">
|
||||
<p>Are you sure delete this task?</p>
|
||||
<p>Are you sure delete this task?</p>
|
||||
</template>
|
||||
<a-button>Left</a-button>
|
||||
</a-popconfirm>
|
||||
<a-popconfirm placement="leftBottom" okText="Yes" cancelText="No" @confirm="confirm">
|
||||
<template slot="title">
|
||||
<p>Are you sure delete this task?</p>
|
||||
<p>Are you sure delete this task?</p>
|
||||
</template>
|
||||
<a-button>LB</a-button>
|
||||
</a-popconfirm>
|
||||
</div>
|
||||
<div :style="{ width: `${buttonWidth}px`, marginLeft: `${buttonWidth * 4 + 24 }px`}">
|
||||
<a-popconfirm placement="rightTop" okText="Yes" cancelText="No" @confirm="confirm">
|
||||
<template slot="title">
|
||||
<p>Are you sure delete this task?</p>
|
||||
<p>Are you sure delete this task?</p>
|
||||
</template>
|
||||
<a-button>RT</a-button>
|
||||
</a-popconfirm>
|
||||
<a-popconfirm placement="right" okText="Yes" cancelText="No" @confirm="confirm">
|
||||
<template slot="title">
|
||||
<p>Are you sure delete this task?</p>
|
||||
<p>Are you sure delete this task?</p>
|
||||
</template>
|
||||
<a-button>Right</a-button>
|
||||
</a-popconfirm>
|
||||
<a-popconfirm placement="rightBottom" okText="Yes" cancelText="No" @confirm="confirm">
|
||||
<template slot="title">
|
||||
<p>Are you sure delete this task?</p>
|
||||
<p>Are you sure delete this task?</p>
|
||||
</template>
|
||||
<a-button>RB</a-button>
|
||||
</a-popconfirm>
|
||||
</div>
|
||||
<div :style="{ marginLeft: `${buttonWidth}px`, clear: 'both', whiteSpace: 'nowrap' }">
|
||||
<a-popconfirm placement="bottomLeft" okText="Yes" cancelText="No" @confirm="confirm">
|
||||
<template slot="title">
|
||||
<p>Are you sure delete this task?</p>
|
||||
<p>Are you sure delete this task?</p>
|
||||
</template>
|
||||
<a-button>BL</a-button>
|
||||
</a-popconfirm>
|
||||
<a-popconfirm placement="bottom" okText="Yes" cancelText="No" @confirm="confirm">
|
||||
<template slot="title">
|
||||
<p>Are you sure delete this task?</p>
|
||||
<p>Are you sure delete this task?</p>
|
||||
</template>
|
||||
<a-button>Bottom</a-button>
|
||||
</a-popconfirm>
|
||||
<a-popconfirm placement="bottomRight" okText="Yes" cancelText="No" @confirm="confirm">
|
||||
<template slot="title">
|
||||
<p>Are you sure delete this task?</p>
|
||||
<p>Are you sure delete this task?</p>
|
||||
</template>
|
||||
<a-button>BR</a-button>
|
||||
</a-popconfirm>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { message } from 'antd'
|
||||
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
buttonWidth: 70,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
confirm () {
|
||||
message.info('Click on Yes.')
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
#components-a-popconfirm-demo-placement .ant-btn {
|
||||
width: 70px;
|
||||
text-align: center;
|
||||
padding: 0;
|
||||
margin-right: 8px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
</style>
|
||||
```
|
||||
|
@ -0,0 +1,21 @@
|
||||
## API
|
||||
|
||||
| Param | Description | Type | Default value |
|
||||
| ----- | ----------- | ---- | ------------- |
|
||||
| cancelText | text of the Cancel button | string | `Cancel` |
|
||||
| okText | text of the Confirm button | string | `Confirm` |
|
||||
| okType | Button `type` of the Confirm button | string | `primary` |
|
||||
| title | title of the confirmation box | string\|slot | - |
|
||||
|
||||
### events
|
||||
| Events Name | Description | Arguments |
|
||||
| --- | --- | --- |
|
||||
| cancel | callback of cancel | function(e) | - |
|
||||
| confirm | callback of confirmation | function(e) | - |
|
||||
| visibleChange | Callback executed when visibility of the tooltip card is changed | function(visible) | - |
|
||||
|
||||
Consult [Tooltip's documentation](#/us/components/tooltip/#API) to find more APIs.
|
||||
|
||||
## Note
|
||||
|
||||
Please ensure that the child node of `Popconfirm` accepts `mouseenter`, `mouseleave`, `focus`, `click` events.
|
Loading…
Reference in new issue