Dom widget store (#2899)

This commit is contained in:
Chenlei Hu
2025-03-06 13:23:58 -05:00
committed by GitHub
parent caaf050728
commit f7be9157e0
7 changed files with 126 additions and 23 deletions

View File

@@ -0,0 +1,22 @@
<template>
<div>
<DomWidget v-for="widget in widgets" :key="widget.id" :widget="widget" />
</div>
</template>
<script setup lang="ts">
import { computed } from 'vue'
import DomWidget from '@/components/graph/widgets/DomWidget.vue'
import { DOMWidget } from '@/scripts/domWidget'
import { useDomWidgetStore } from '@/stores/domWidgetStore'
const domWidgetStore = useDomWidgetStore()
const widgets = computed(() =>
Array.from(
domWidgetStore.widgetInstances.values() as Iterable<
DOMWidget<HTMLElement, object | string>
>
)
)
</script>