mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2024-12-27 05:00:48 +08:00
19 lines
238 B
Markdown
19 lines
238 B
Markdown
# 事件
|
|
处理按钮的事件。
|
|
```html
|
|
<n-button @click="handleClick">
|
|
点它
|
|
</n-button>
|
|
```
|
|
|
|
```js
|
|
export default {
|
|
inject: ['message'],
|
|
methods: {
|
|
handleClick () {
|
|
this.message.info('Button Clicked')
|
|
}
|
|
}
|
|
}
|
|
```
|