fix: 修复element-plus全局组件大小设置无效调整为config-provider方式
Former-commit-id: ddb0e86a2ab660fb442c7425d475d29bf58b8a6d
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<el-config-provider :locale="locale">
|
||||
<router-view/>
|
||||
<el-config-provider :locale="locale" :size="size">
|
||||
<router-view />
|
||||
</el-config-provider>
|
||||
</template>
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -32,7 +32,6 @@ const sizeOptions = ref([
|
||||
|
||||
function handleSetSize(size: string) {
|
||||
app.setSize(size);
|
||||
window.location.reload();
|
||||
ElMessage.success("切换布局大小成功");
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user