Skip to content

Commit

Permalink
Merge pull request #85 from nih-sparc/add_dashboard_to_pages
Browse files Browse the repository at this point in the history
Add dashboard to pages
  • Loading branch information
egauzens authored May 2, 2024
2 parents 870b26c + 90a7b3b commit 505daed
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 2 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@
"striptags": "^3.2.0",
"uint8array-extras": "^1.0.0",
"vue-chartjs": "^5.3.0",
"vue-social-sharing": "^4.0.0-alpha4"
"vue-social-sharing": "^4.0.0-alpha4",
"gridstack": "^9.5.0"
},
"resolutions": {
"string-width": "4.2.3",
Expand Down
13 changes: 13 additions & 0 deletions pages/apps/dashboard/index.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<template>
<SparcDashboard></SparcDashboard>
</template>
<script setup lang="ts">
import SparcDashboard from "@/TestDashboard/src/components/SparcDashboard.vue"
import '@/plugins/dashboard.js'
</script>
<style scoped lang="scss">
</style>
24 changes: 24 additions & 0 deletions plugins/dashboard.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import mitt from 'mitt'
import { defineAsyncComponent } from 'vue'
import { useGlobalVarsStore } from '@/TestDashboard/src/stores/globalVars'
import "@/TestDashboard/tailwind/output.css"

const emitter = mitt();

const componentMap = [
'ImageSelector',
'LocationNav',
'FlatmapViewer',
'BiolucidaViewer',
'QDBChart'
]

export default defineNuxtPlugin((nuxtApp) => {
nuxtApp.vueApp.provide('emitter', emitter);
componentMap.forEach(comp=>{
const asyncComponent = defineAsyncComponent(() => import(`@/TestDashboard/src/components/${comp}.vue`));
nuxtApp.vueApp.component(comp, asyncComponent);
})
const globalVars = useGlobalVarsStore();
globalVars.componentList = componentMap;
})

0 comments on commit 505daed

Please sign in to comment.