Skip to content

Commit 8b2bc2b

Browse files
authoredMar 1, 2022
Add open and close events to Tooltip (#3694)
1 parent 1d3b547 commit 8b2bc2b

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed
 

‎docs/pages/components/tooltip/api/tooltip.js

+12
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,18 @@ export default [
102102
values: '—',
103103
default: '<code>false</code>'
104104
}
105+
],
106+
events: [
107+
{
108+
name: '<code>open</code>',
109+
description: 'Triggers when the tooltip is opened',
110+
parameters: '—'
111+
},
112+
{
113+
name: '<code>close</code>',
114+
description: 'Triggers when the tooltip is closed',
115+
parameters: '—'
116+
},
105117
]
106118
}
107119
]

‎src/components/tooltip/Tooltip.vue

+2-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@ export default {
107107
}
108108
},
109109
watch: {
110-
isActive(value) {
110+
isActive() {
111+
this.$emit(this.isActive ? 'open' : 'close')
111112
if (this.appendToBody) {
112113
this.updateAppendToBody()
113114
}

0 commit comments

Comments
 (0)
Please sign in to comment.