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