mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2025-01-06 12:17:13 +08:00
26 lines
541 B
Markdown
26 lines
541 B
Markdown
# 事件
|
|
`positive-click` & `negative-click`
|
|
```html
|
|
<n-popconfirm
|
|
@positive-click="handlePositiveClick"
|
|
@negative-click="handleNegativeClick"
|
|
>
|
|
<template v-slot:trigger>
|
|
<n-button>退出游戏</n-button>
|
|
</template>
|
|
我看 B 站的时候,听说有些游戏冲钱也是找罪受。
|
|
</n-popconfirm>
|
|
```
|
|
```js
|
|
export default {
|
|
inject: ['message'],
|
|
methods: {
|
|
handlePositiveClick () {
|
|
this.message.info('positive click')
|
|
},
|
|
handleNegativeClick () {
|
|
this.message.info('negative click')
|
|
}
|
|
}
|
|
}
|
|
``` |