naive-ui/demo/documentation/components/popconfirm/enUS/customAction.md

42 lines
811 B
Markdown
Raw Normal View History

2019-10-21 15:37:41 +08:00
# Custom Action
```html
2019-12-23 16:31:26 +08:00
<n-popconfirm :controller="controller">
2019-10-21 15:37:41 +08:00
<template v-slot:activator>
2019-12-23 16:31:26 +08:00
<n-button>Quote</n-button>
2019-10-21 15:37:41 +08:00
</template>
2019-12-23 16:31:26 +08:00
For example, if I were to write about elephants, Id have had no idea what words to use.
2019-10-21 15:37:41 +08:00
<template v-slot:action>
<n-button
size="tiny"
2019-12-23 16:31:26 +08:00
@click="handleClick"
2019-10-21 15:37:41 +08:00
>
2019-12-23 16:31:26 +08:00
Maybe
2019-10-21 15:37:41 +08:00
</n-button>
</template>
</n-popconfirm>
2019-12-23 16:31:26 +08:00
<n-popconfirm positive-text="Oops!">
<template v-slot:activator>
<n-button>Quote</n-button>
</template>
For example, if I were to write about elephants, Id have had no idea what words to use.
</n-popconfirm>
```
```js
export default {
data () {
return {
controller: {}
}
},
methods: {
handleClick () {
this.controller.hide()
}
}
}
```
```css
.n-button {
margin-right: 8px;
}
2019-10-21 15:37:41 +08:00
```