mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2025-01-12 12:25:16 +08:00
42 lines
811 B
Markdown
42 lines
811 B
Markdown
# 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, I’d 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, I’d 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;
|
||
}
|
||
``` |