Skip to content

Commit

Permalink
⚡️improve module import
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidZhang73 committed Nov 14, 2023
1 parent 6c4affd commit 3b15ff7
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 11 deletions.
4 changes: 1 addition & 3 deletions src/pages/annotation/Annotation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,16 @@
</template>

<script setup>
import { defineAsyncComponent } from 'vue'
import ActionTable from '~/pages/annotation/ActionTable.vue'
import CanvasPanel from '~/pages/annotation/CanvasPanel.vue'
import ControlPanel from '~/pages/annotation/ControlPanel.vue'
import AnnotationSkeleton from './components/AnnotationSkeleton.vue'
import { useAnnotationStore } from '~/store/annotation.js'
import { useConfigurationStore } from '~/store/configuration.js'
import { useMainStore } from '~/store/index.js'
import { usePreferenceStore } from '~/store/preference.js'
import KeyframePanel from './KeyframePanel.vue'
const AnnotationSkeleton = defineAsyncComponent(() => import('./components/AnnotationSkeleton.vue'))
const annotationStore = useAnnotationStore()
const configurationStore = useConfigurationStore()
const preferenceStore = usePreferenceStore()
Expand Down
5 changes: 2 additions & 3 deletions src/pages/configuration/components/TableBase.vue
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,10 @@

<script setup>
import { storeToRefs } from 'pinia'
import { computed, defineAsyncComponent, ref } from 'vue'
import { computed, ref } from 'vue'
import { useConfigurationStore } from '~/store/configuration.js'
import { useMainStore } from '~/store/index.js'
const TableEditor = defineAsyncComponent(() => import('~/pages/configuration/components/TableEditor.vue'))
import TableEditor from '~/pages/configuration/components/TableEditor.vue'
const props = defineProps({
title: {
Expand Down
4 changes: 2 additions & 2 deletions src/pages/configuration/components/TableEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
</template>

<script setup>
import { ref } from 'vue'
import MonacoCodeEditor from '~/components/MonacoCodeEditor.vue'
import { ref, defineAsyncComponent } from 'vue'
import utils from '~/libs/utils.js'
const MonacoCodeEditor = defineAsyncComponent(() => import('~/components/MonacoCodeEditor.vue'))
const props = defineProps({
modelValue: {
Expand Down
3 changes: 2 additions & 1 deletion src/router/index.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import { createRouter, createWebHashHistory } from 'vue-router'
import { useAnnotationStore } from '~/store/annotation.js'
import { useConfigurationStore } from '~/store/configuration.js'
import Annotation from '~/pages/annotation/Annotation.vue'

const router = createRouter({
history: createWebHashHistory(),
routes: [
{
name: 'annotation',
path: '/',
component: () => import('~/pages/annotation/Annotation.vue')
component: Annotation
},
{
name: 'configuration',
Expand Down
4 changes: 2 additions & 2 deletions vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ export default defineConfig({
monacoEditorPlugin({
languageWorkers: ['editorWorkerService', 'json'],
publicPath: 'https://unpkg.com/[email protected]/cdn'
})
}),
],
define: {
PACKAGE_VERSION: JSON.stringify(process.env.npm_package_version)
}
},
})

0 comments on commit 3b15ff7

Please sign in to comment.