perf: 代码优化 App.vue
This commit is contained in:
parent
53694a35be
commit
e8d0f9ba9d
@ -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>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user