forked from open-webui/open-webui
fix: tooltip
This commit is contained in:
parent
63c0927022
commit
f9482275f2
1 changed files with 8 additions and 7 deletions
|
@ -10,18 +10,19 @@
|
||||||
|
|
||||||
$: if (tooltipElement && content) {
|
$: if (tooltipElement && content) {
|
||||||
if (tooltipInstance) {
|
if (tooltipInstance) {
|
||||||
tooltipInstance[0]?.destroy();
|
tooltipInstance.setContent(content);
|
||||||
}
|
} else {
|
||||||
tooltipInstance = tippy(tooltipElement, {
|
tooltipInstance = tippy(tooltipElement, {
|
||||||
content: content,
|
content: content,
|
||||||
placement: placement,
|
placement: placement,
|
||||||
allowHTML: true
|
allowHTML: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onDestroy(() => {
|
onDestroy(() => {
|
||||||
if (tooltipInstance) {
|
if (tooltipInstance) {
|
||||||
tooltipInstance[0]?.destroy();
|
tooltipInstance.destroy();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in a new issue