From ab6cc17281b289ca04db130fff2c02dcdac604b4 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, 26 Mar 2022 10:30:58 +0800 Subject: [PATCH] style: eslint --- example/src/components/LayAnchor.vue | 1 - example/src/layouts/Layout.vue | 83 +++++++++++++++++++++++++--- package.json | 1 + src/component/switch/index.vue | 10 ++-- src/component/table/index.vue | 4 +- src/theme/variable.less | 6 +- src/utils/guidUtil.ts | 19 +------ 7 files changed, 88 insertions(+), 36 deletions(-) diff --git a/example/src/components/LayAnchor.vue b/example/src/components/LayAnchor.vue index 635ea10f..4da1739f 100644 --- a/example/src/components/LayAnchor.vue +++ b/example/src/components/LayAnchor.vue @@ -166,7 +166,6 @@ const throttle = (func: Function, wait: number) => { box-sizing: border-box; width: 180px; padding: 0 25px; - background-color: #ffffff; border-left: 1px solid rgb(229 230 235); transition: none; -webkit-transition: none; diff --git a/example/src/layouts/Layout.vue b/example/src/layouts/Layout.vue index c18b2961..fab62bcc 100644 --- a/example/src/layouts/Layout.vue +++ b/example/src/layouts/Layout.vue @@ -150,12 +150,63 @@
  • - + @@ -189,7 +240,7 @@ export default { { name: "zh_CN", locale: zh_CN, merge: true }, { name: "en_US", locale: en_US, merge: true }, ]; - const theme = "light"; + const theme = ref("light"); const themeVariable = ref({ "--global-primary-color": "#009688", "--global-normal-color": "#1e9fff", @@ -215,6 +266,14 @@ export default { }); }); + watch(isDark, () => { + if (isDark.value) { + theme.value = "dark"; + } else { + theme.value = "light"; + } + }); + watch( () => route.path, (val) => { @@ -264,6 +323,12 @@ export default { box-shadow: 2px 0 8px 0 rgb(29 35 41 / 5%); } +.layui-layout-document .layui-body, +.layui-layout-document .layui-menu, +.layui-layout-document .lay-aside { + background-color: var(--global-back-color); +} + .layui-layout-document > .layui-layout > .layui-body { margin-top: 60px; left: 200px; @@ -308,11 +373,11 @@ export default { } .switch svg { - position: absolute; - width: 12px; - height: 12px; - top: 3px; - left: 3px; + position: absolute; + width: 12px; + height: 12px; + top: 3px; + left: 3px; } @media screen and (max-width: 768px) { diff --git a/package.json b/package.json index dd063ed7..fa68d5e7 100644 --- a/package.json +++ b/package.json @@ -44,6 +44,7 @@ "vue": "^3.2.31", "vue-i18n": "^9.2.0-beta.33", "vue-router": "^4.0.12", + "uuid": "^8.3.2", "xlsx": "^0.18.4" }, "devDependencies": { diff --git a/src/component/switch/index.vue b/src/component/switch/index.vue index 78592aa0..a38d627c 100644 --- a/src/component/switch/index.vue +++ b/src/component/switch/index.vue @@ -39,16 +39,18 @@ const handleClick = function () { } }; - const styles = computed(() => { - return { 'background-color': isActive.value ? props.onswitchColor : props.unswitchColor} -}) + return { + "background-color": isActive.value + ? props.onswitchColor + : props.unswitchColor, + }; +});