From 497e117567a2e654197e567c9b9f463a4d9daab6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=B1=E7=9C=A0=E5=84=80=E5=BC=8F?= <854085467@qq.com> Date: Sat, 2 Apr 2022 06:43:28 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E4=BC=98=E5=8C=96=20=E5=A4=9C=E9=97=B4?= =?UTF-8?q?=E4=B8=BB=E9=A2=98=20=E5=88=87=E6=8D=A2=E7=AD=96=E7=95=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- example/src/layouts/Layout.vue | 15 +++------------ example/src/view/index.vue | 5 +---- src/component/empty/index.vue | 4 ++-- 3 files changed, 6 insertions(+), 18 deletions(-) diff --git a/example/src/layouts/Layout.vue b/example/src/layouts/Layout.vue index 131c8be4..5cdff9b2 100644 --- a/example/src/layouts/Layout.vue +++ b/example/src/layouts/Layout.vue @@ -140,8 +140,10 @@
  • @@ -223,7 +225,6 @@ export default { const route = useRoute(); const router = useRouter(); const locale = ref("zh_CN"); - const isDark = ref(false); const locales = [ { name: "zh_CN", locale: zh_CN, merge: true }, { name: "en_US", locale: en_US, merge: true }, @@ -268,14 +269,6 @@ export default { import.meta.env.LAYUI_VUE_VERSION ) - watch(isDark, () => { - if (isDark.value) { - theme.value = "dark"; - } else { - theme.value = "light"; - } - }); - watch( () => route.path, (val) => { @@ -292,7 +285,6 @@ export default { locale.value = lang; }; - provide("isDark",isDark); provide("theme",theme); provide('LayuiVueVersion', layuiVueVersion); @@ -301,7 +293,6 @@ export default { menus, theme, locale, - isDark, locales, currentPath, handleClick, diff --git a/example/src/view/index.vue b/example/src/view/index.vue index fe47ef1b..f404a706 100644 --- a/example/src/view/index.vue +++ b/example/src/view/index.vue @@ -18,7 +18,7 @@ - {{ isDark ? 'Turn Off' : 'Turn On'}} + {{ theme === 'dark' ? 'Turn Off' : 'Turn On'}}
    @@ -115,11 +115,9 @@ export default { setup() { const { t } = useI18n(); const layuiVueVersion = inject('LayuiVueVersion') - const isDark = inject("isDark"); const theme = inject("theme"); const changeTheme = () => { - isDark.value = !isDark.value; if(theme.value === 'dark') { theme.value = 'light'; } else { @@ -129,7 +127,6 @@ export default { return { t, - isDark, theme, changeTheme, layuiVueVersion diff --git a/src/component/empty/index.vue b/src/component/empty/index.vue index c923353e..7ae14d5f 100644 --- a/src/component/empty/index.vue +++ b/src/component/empty/index.vue @@ -28,7 +28,7 @@ const props = withDefaults(defineProps(), { {{ description }}
    - -
    + +