diff --git a/src/App.vue b/src/App.vue index 68fd21e7..9c8c0a10 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,6 +1,6 @@ @@ -17,6 +17,7 @@ import en from "element-plus/es/locale/lang/en"; const { app } = useStore(); const language = computed(() => app.language); +const size: any = computed(() => app.size); const locale = ref(); diff --git a/src/components/SizeSelect/index.vue b/src/components/SizeSelect/index.vue index dc8729fd..92b7031c 100644 --- a/src/components/SizeSelect/index.vue +++ b/src/components/SizeSelect/index.vue @@ -32,7 +32,6 @@ const sizeOptions = ref([ function handleSetSize(size: string) { app.setSize(size); - window.location.reload(); ElMessage.success("切换布局大小成功"); } diff --git a/src/main.ts b/src/main.ts index e5c254a1..7af01f38 100644 --- a/src/main.ts +++ b/src/main.ts @@ -38,6 +38,6 @@ app.config.globalProperties.$listDictsByCode = listDictsByCode app.component('Pagination', Pagination) .use(createPinia()) .use(router) - .use(ElementPlus, {size: localStorage.get('size') || 'default'}) + .use(ElementPlus) .use(i18n) .mount('#app')