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

[full-ci] Vue3: Update vue-router #8215

Merged
merged 18 commits into from
Jan 17, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions packages/design-system/src/directives/OcTooltip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@ export const destroy = (_tippy) => {
}
}

const initOrUpdate = (el, { value = {} }: any, { elm }) => {
const initOrUpdate = (el, { value = {} }: any) => {
if (Object.prototype.toString.call(value) !== '[object Object]') {
value = { content: value }
}

if (value.content !== 0 && !value.content) {
destroy(elm.tooltip)
elm.tooltip = null
if ((value.content !== 0 && !value.content) || value.content === '') {
kulmann marked this conversation as resolved.
Show resolved Hide resolved
destroy(el.tooltip)
el.tooltip = null
return
}

Expand All @@ -69,20 +69,20 @@ const initOrUpdate = (el, { value = {} }: any, { elm }) => {
value
])

if (!elm.tooltip) {
elm.tooltip = tippy(el, {
if (!el.tooltip) {
el.tooltip = tippy(el, {
...props,
plugins: [hideOnEsc, ariaHidden]
})
return
}

elm.tooltip.setProps(props)
el.tooltip.setProps(props)
}

export default {
name: 'OcTooltip',
beforeMount: initOrUpdate,
updated: initOrUpdate,
unmounted: (el, binding, { elm }) => destroy(elm.tooltip)
unmounted: (el, binding) => destroy(el.tooltip)
}