Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commitae9d901

Browse files
committed
fix(CTooltip): add missing updateTitle functionality
1 parentdd02660 commitae9d901

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

‎src/directives/CTooltip.js

Lines 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=newTooltip(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
constprops=binding.value
2123
consttitle=props.content||props
22-
consthtml=props.html===false ?false :true
24+
consthtml=!!props.html!==false
2325
// const modifiersTriggers = String(Object.keys(binding.modifiers)).replace(',',' ')
24-
constcloseOnClickOutside=props.closeOnClickOutside===false ?false :true
26+
constcloseOnClickOutside=!!props.closeOnClickOutside!==false
2527
constpopperOptions=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+
consttitle=binding.value.content
55+
el._c_tooltip.updateTitleContent(title)
56+
el._c_tooltip.show()
57+
})
58+
}
4759
}
4860
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp