Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ae9d901

Browse filesBrowse files
committed
fix(CTooltip): add missing updateTitle functionality
1 parent dd02660 commit ae9d901
Copy full SHA for ae9d901

File tree

Expand file treeCollapse file tree

1 file changed

+14
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+14
-2
lines changed

‎src/directives/CTooltip.js

Copy file name to clipboardExpand all lines: src/directives/CTooltip.js
+14-2Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export default {
55
name: 'c-tooltip',
66
inserted (el, binding) {
77
binding.def._tooltip = new Tooltip(el, binding.def.getTooltipConfig(binding))
8+
el._c_tooltip = binding.def._tooltip
89
if (binding.value.active) {
910
binding.def._tooltip.show()
1011
}
@@ -14,14 +15,15 @@ export default {
1415
if (tooltip) {
1516
tooltip.dispose()
1617
tooltip = null
18+
el._c_tooltip = null
1719
}
1820
},
1921
getTooltipConfig (binding) {
2022
const props = binding.value
2123
const title = props.content || props
22-
const html = props.html === false ? false : true
24+
const html = !!props.html !== false
2325
// const modifiersTriggers = String(Object.keys(binding.modifiers)).replace(',',' ')
24-
const closeOnClickOutside = props.closeOnClickOutside === false ? false : true
26+
const closeOnClickOutside = !!props.closeOnClickOutside !== false
2527
const popperOptions = props.popperOptions || { modifiers: { preventOverflow: { boundariesElement: 'offsetParent' }}}
2628
return {
2729
title,
@@ -44,5 +46,15 @@ export default {
4446
<div class="arrow"></div>
4547
<div class="tooltip-old-inner"></div>
4648
</div>`
49+
},
50+
update(el, binding, vnode) {
51+
if (binding.value.content !== binding.oldValue.content && el === vnode.elm) {
52+
el._c_tooltip.hide()
53+
vnode.context.$nextTick(() => {
54+
const title = binding.value.content
55+
el._c_tooltip.updateTitleContent(title)
56+
el._c_tooltip.show()
57+
})
58+
}
4759
}
4860
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.