naive-ui/demo/documentation/components/popconfirm/enUS/customAction.md
2019-12-23 16:31:26 +08:00

42 lines
811 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Custom Action
```html
<n-popconfirm :controller="controller">
<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.
<template v-slot:action>
<n-button
size="tiny"
@click="handleClick"
>
Maybe
</n-button>
</template>
</n-popconfirm>
<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;
}
```