Browse Source

fix: Table组件注册为全局组件报错问题,存在对pinia的提前引用

陈财富 1 year ago
parent
commit
1e209a702a
1 changed files with 3 additions and 5 deletions
  1. 3 5
      src/components/Table/src/components/TableActions.vue

+ 3 - 5
src/components/Table/src/components/TableActions.vue

@@ -7,11 +7,6 @@ import { useAppStore } from '@/store/modules/app'
 import { TableColumn } from '../types'
 import { TableColumn } from '../types'
 import ColumnSetting from './ColumnSetting.vue'
 import ColumnSetting from './ColumnSetting.vue'
 
 
-const appStore = useAppStore()
-const sizeMap = computed(() => appStore.sizeMap)
-
-const { t } = useI18n()
-
 export default defineComponent({
 export default defineComponent({
   name: 'TableActions',
   name: 'TableActions',
   components: {
   components: {
@@ -25,6 +20,9 @@ export default defineComponent({
   },
   },
   emits: ['refresh', 'changSize', 'confirm'],
   emits: ['refresh', 'changSize', 'confirm'],
   setup(props, { emit }) {
   setup(props, { emit }) {
+    const appStore = useAppStore()
+    const { t } = useI18n()
+    const sizeMap = computed(() => appStore.sizeMap)
     const showSetting = ref(false)
     const showSetting = ref(false)
 
 
     const refresh = () => {
     const refresh = () => {