Skip to content

Commit

Permalink
fix tooltip error on topology
Browse files Browse the repository at this point in the history
  • Loading branch information
elevatebart committed Jan 14, 2025
1 parent 085171b commit 9072ae7
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
3 changes: 2 additions & 1 deletion src/components/misc/Tooltip.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@
onMounted(async () => {
nextTick(async () => {
const Bootstrap = await bootstrap
if (typeof document !== "undefined" && $tooltip.value && $tooltipContent.value) {
tooltip.value = new (await bootstrap).Tooltip($tooltip.value, {
tooltip.value = new Bootstrap.Tooltip($tooltip.value, {
trigger: "hover",
html: true,
placement: props.placement,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {shallowRef} from "vue";
import {shallowRef, ref, nextTick} from "vue";
import {useVueFlow} from "@vue-flow/core";
import lodash from "lodash";

import TopologyComponent from "../../../src/components/topology/Topology.vue";
Expand All @@ -13,15 +14,23 @@ const base = {
render: (args, {loaded: {flowGraph, source}}) => ({
components: {TopologyComponent},
setup() {
return {args, flowGraph: flowGraph, source: source};
const vueflowId = ref(Math.random().toString());
const {
fitView
} = useVueFlow({id: vueflowId.value});

nextTick(() => {
fitView();
});

return () => <TopologyComponent {...args} source={source} flowGraph={flowGraph} />;
},
template: `<TopologyComponent v-bind="args" :source="source" :flow-graph="flowGraph" />`,
}),
decorators: [() => ({
template: `<div style="outline: 1px solid var(--ks-select-border);width: calc(100vw - 2rem);height: calc(100vh - 2rem);">
<story />
</div>`
})],
// decorators: [() => ({
// template: `<div style="outline: 1px solid var(--ks-select-border);width: calc(100vw - 2rem);height: calc(100vh - 2rem);">
// <story />
// </div>`
// })],
args: {
id: "test",
isHorizontal: true,
Expand Down

1 comment on commit 9072ae7

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.