perf: add static router

This commit is contained in:
kailong321200875
2022-07-30 10:05:53 +08:00
parent 55d4ce7e35
commit 55522b0661
7 changed files with 48 additions and 7 deletions

View File

@@ -1,5 +1,5 @@
<script setup lang="ts">
import { ElSwitch } from 'element-plus'
import { ElSwitch, ElMessage } from 'element-plus'
import { useI18n } from '@/hooks/web/useI18n'
import { useAppStore } from '@/store/modules/app'
import { computed, ref, watch } from 'vue'
@@ -107,6 +107,14 @@ const greyModeChange = (show: boolean) => {
appStore.setGreyMode(show)
}
// 动态路由
const dynamicRouter = ref(appStore.getDynamicRouter)
const dynamicRouterChange = (show: boolean) => {
ElMessage.info(t('setting.reExperienced'))
appStore.setDynamicRouter(show)
}
const layout = computed(() => appStore.getLayout)
watch(
@@ -185,5 +193,10 @@ watch(
<span class="text-14px">{{ t('setting.greyMode') }}</span>
<ElSwitch v-model="greyMode" @change="greyModeChange" />
</div>
<div class="flex justify-between items-center">
<span class="text-14px">{{ t('setting.dynamicRouter') }}</span>
<ElSwitch v-model="dynamicRouter" @change="dynamicRouterChange" />
</div>
</div>
</template>