perf: 代码优化 App.vue

This commit is contained in:
pany 2023-06-16 18:11:41 +08:00
parent 53694a35be
commit e8d0f9ba9d

View File

@ -2,15 +2,15 @@
import { h } from "vue" import { h } from "vue"
import { useTheme } from "@/hooks/useTheme" import { useTheme } from "@/hooks/useTheme"
import { ElNotification } from "element-plus" import { ElNotification } from "element-plus"
// Element Plus
import zhCn from "element-plus/lib/locale/lang/zh-cn" import zhCn from "element-plus/lib/locale/lang/zh-cn"
const { initTheme } = useTheme() const { initTheme } = useTheme()
/** 初始化主题 */ /** 初始化主题 */
initTheme() initTheme()
/** 将 Element Plus 的语言设置为中文 */
const locale = zhCn
/** 作者小心思 */
ElNotification({ ElNotification({
title: "Hello", title: "Hello",
message: h( message: h(
@ -24,7 +24,7 @@ ElNotification({
</script> </script>
<template> <template>
<ElConfigProvider :locale="locale"> <ElConfigProvider :locale="zhCn">
<router-view /> <router-view />
</ElConfigProvider> </ElConfigProvider>
</template> </template>