Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration to Tippy 3.3.0 #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 1 addition & 2 deletions example/App.vue
Expand Up @@ -13,8 +13,7 @@
<strong>this is html</strong>
</div>
<button
:title="settings.title"
v-tippy="{placement: settings.placement, onShown: settings.onShown, html: html ? '#html' : undefined}"
v-tippy="{placement: settings.placement, content:settings.title, onShown: settings.onShown, allowHTML: html ? true : false}"
>
hover me
</button>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -24,7 +24,7 @@
"license": "MIT",
"dependencies": {
"nano-assign": "^1.0.0",
"tippy.js": "^2.5.2"
"tippy.js": "^3.4.0"
},
"devDependencies": {
"bili": "^0.17.0",
Expand Down
10 changes: 3 additions & 7 deletions src/tippy.js
Expand Up @@ -13,19 +13,15 @@ export default (opts = {}) => {
if (el._tippy) {
if (hasBindingChanged(value, oldValue)) {
// Re-initialize the element when binding value changes
// TODO: find a way to update settings w/o recreate the tippy instance
el._tippy.destroy()
tippy(el, {
el._tippy.set({
...opts,
...value,
dynamicTitle: true
...value
})
}
} else {
tippy(el, {
...opts,
...value,
dynamicTitle: true
...value
})
}
}
Expand Down