naive-ui/demo/documentation/components/tooltip/enUS/event.md

71 lines
1.1 KiB
Markdown
Raw Normal View History

2019-09-28 13:47:54 +08:00
# Event
```html
<n-tooltip
placement="bottom"
trigger="hover"
@show="handleShow"
@hide="handleHide"
>
<template v-slot:activator>
<n-button>
2020-01-30 17:38:14 +08:00
Hover
2019-09-28 13:47:54 +08:00
</n-button>
</template>
<span>
I wish they all could be California girls
</span>
</n-tooltip>
<n-tooltip
placement="bottom"
trigger="click"
@show="handleShow"
@hide="handleHide"
>
<template v-slot:activator>
<n-button>
2020-01-30 17:38:14 +08:00
Click
2019-09-28 13:47:54 +08:00
</n-button>
</template>
<span>
I wish they all could be California girls
</span>
</n-tooltip>
<n-tooltip
2020-02-07 00:05:44 +08:00
:show="showPopover"
2019-09-28 13:47:54 +08:00
placement="bottom"
trigger="manual"
@show="handleShow"
@hide="handleHide"
>
<template v-slot:activator>
<n-button @click="showPopover = !showPopover">
2020-01-30 17:38:14 +08:00
Manual
2019-09-28 13:47:54 +08:00
</n-button>
</template>
<span>
I wish they all could be California girls
</span>
</n-tooltip>
```
```js
export default {
data() {
return {
showPopover: false
};
},
methods: {
handleShow() {
this.$NMessage.success("show tooltip");
},
handleHide() {
this.$NMessage.success("hide tooltip");
}
}
};
```
```css
.n-button {
margin: 0 12px 8px 0;
}
```