// ./src/Components/UnitsTable.vue\n\n<script setup lang=\"ts\">\nimport Panel from '@/components/Common/Panel.vue'\nimport { computed } from 'vue'\n\nimport { useRepo } from 'pinia-orm'\nimport { UnitEntity } from '@/stores/units'\n\nconst unitsRepo = computed(() => {\n return useRepo(UnitEntity)\n})\n</script>\n<template>\n <Panel>\n <template v-slot:body>\n <div class=\"row g-0\">\n <table class=\"table table-sm table-hover\">\n <thead>\n <tr>\n <th scope=\"col\">Unit</th>\n <th scope=\"col\">Type</th>\n <th scope=\"col\">Status</th>\n <th scope=\"col\">Location</th>\n <th scope=\"col\">Assigned Event</th>\n </tr>\n </thead>\n <tbody>\n <tr v-for=\"unit in unitsRepo.withAll().get()\" :key=\"unit.id\">\n <th scope=\"row\">{{ unit.callsign }}</th>\n <td>{{ unit.unitType }}</td>\n <td>{{ unit.status }}</td>\n <td>{{ unit.location }}</td>\n <td>{{ unit.assignedEvent?.id }}</td>\n </tr>\n </tbody>\n </table>\n </div>\n </template>\n </Panel>\n</template>\n@/stores/units\n
// ./src/main.ts\n\n\nimport { createApp } from 'vue'\nimport router from './router'\n\nimport '@/main.scss'\nimport 'dockview-vue/dist/styles/dockview.css'\n\nimport DockView from './DockView.vue'\n\nconst app = createApp(DockView)\n\napp.mount('#app')\n
Ah! Figured it out! Meta AI suggested this:
\napp.component('UnitsTable', UnitsTable)
in main.ts
Here's the full main.ts file:
\nimport { createApp } from 'vue'\nimport { createPinia } from 'pinia'\nimport { createORM } from 'pinia-orm'\n\nimport { PiniaSharedState } from 'pinia-shared-state'\n\nimport App from './App.vue'\nimport router from './router'\n\nimport '@/main.scss'\nimport 'fundamental-styles/dist/theming/sap_horizon_dark.css'\nimport '@sap-theming/theming-base-content/content/Base/baseLib/sap_horizon_dark/css_variables.css'\nimport 'dockview-vue/dist/styles/dockview.css'\n\nimport urql, { cacheExchange, fetchExchange } from '@urql/vue'\n\nimport DockView from './DockView.vue'\nimport UnitsTable from './components/UnitsTable.vue'\n\nconst app = createApp(DockView)\n\napp.use(\n createPinia()\n .use(createORM())\n .use(PiniaSharedState({ enable: true }))\n)\napp.use(router)\n\napp.use(urql, {\n url: 'http://localhost:5107/graphql',\n exchanges: [cacheExchange, fetchExchange]\n})\n\napp.component('UnitsTable', UnitsTable)\n\napp.mount('#app')\n
-
QuestionHow do I register my vue single file components with dockview so that I can register them as dockview panels? The docs state that “You can register panels through the dock option components” does this mean there should be a components option I can pass my key value pair to? EnvironmentVue 3 single page application compiled with vite, using single file components Here’s what I’ve figured out
References usedhttps://github.com/mathuo/dockview/blob/master/packages/dockview-vue/src/utils.ts line 39 Potential changes to dockview-vue to make registering vue components easier
Here's what I've tried (irrelevant lines removed for easier reading)
|
Beta Was this translation helpful? Give feedback.
-
Looks like this is almost a dupe of #608 with more diagnostic information |
Beta Was this translation helpful? Give feedback.
-
Ah! Figured it out! Meta AI suggested this: Here's the full main.ts file:
|
Beta Was this translation helpful? Give feedback.
Ah! Figured it out! Meta AI suggested this:
app.component('UnitsTable', UnitsTable)
in main.tsHere's the full main.ts file: