From b0a3bd0ac994ff4628d0f60b610c055a2128442f 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: Thu, 18 Nov 2021 11:21:57 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=9A=82=E5=AD=98]=20=E9=87=8D=E6=9E=84=20swi?= =?UTF-8?q?tch=20=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/docs/zh-CN/components/switch.md | 23 ++++ docs/docs/zh-CN/guide/norms.md | 2 +- docs/src/view/guide.vue | 6 + src/module/button/index.vue | 12 +- src/module/layer/index.vue | 169 +++++++++++++-------------- src/module/switch/index.vue | 27 +++-- 6 files changed, 139 insertions(+), 100 deletions(-) diff --git a/docs/docs/zh-CN/components/switch.md b/docs/docs/zh-CN/components/switch.md index 0d2c37e7..e90d9122 100644 --- a/docs/docs/zh-CN/components/switch.md +++ b/docs/docs/zh-CN/components/switch.md @@ -3,6 +3,29 @@ ::: demo + + + + +::: + +::: title 基础使用 +::: + +::: demo + diff --git a/docs/docs/zh-CN/guide/norms.md b/docs/docs/zh-CN/guide/norms.md index 1c7a3f8e..2531f05a 100644 --- a/docs/docs/zh-CN/guide/norms.md +++ b/docs/docs/zh-CN/guide/norms.md @@ -1,2 +1,2 @@ ::: title 开发规范 -::: +::: \ No newline at end of file diff --git a/docs/src/view/guide.vue b/docs/src/view/guide.vue index c38796b5..47d02483 100644 --- a/docs/src/view/guide.vue +++ b/docs/src/view/guide.vue @@ -86,6 +86,12 @@ export default { subTitle: 'change log', path: '/zh-CN/guide/changelog', }, + { + id: 4, + title: '规范', + subTitle: 'norms', + path: '/zh-CN/guide/norms' + } ], }, ] diff --git a/src/module/button/index.vue b/src/module/button/index.vue index d91e8fa5..64803050 100644 --- a/src/module/button/index.vue +++ b/src/module/button/index.vue @@ -11,19 +11,19 @@ import { computed } from "vue"; export interface LayButtonProps { type?: "primary" | "normal" | "warm" | "danger"; size?: "lg" | "sm" | "xs"; - fluid?: boolean; - radius?: boolean; + fluid?: boolean | string; + radius?: boolean | string; border?: "green" | "blue" | "orange" | "red" | "black"; - disabled?: boolean; - loading?: boolean; + disabled?: boolean | string; + loading?: boolean | string; nativeType?: "button" | "submit" | "reset"; } const props = withDefaults(defineProps(), { fluid: false, radius: false, - disabled: false, loading: false, + disabled: false, nativeType: "button", }); @@ -43,7 +43,7 @@ const classes = computed(() => { { 'layui-btn-fluid': fluid, 'layui-btn-radius': radius, - 'layui-btn-disabled': disabled + 'layui-btn-disabled': disabled, }, classes, ]" diff --git a/src/module/layer/index.vue b/src/module/layer/index.vue index a8505836..2136ab06 100644 --- a/src/module/layer/index.vue +++ b/src/module/layer/index.vue @@ -83,129 +83,128 @@ diff --git a/src/module/switch/index.vue b/src/module/switch/index.vue index 4becd107..00faa687 100644 --- a/src/module/switch/index.vue +++ b/src/module/switch/index.vue @@ -5,27 +5,37 @@ export default { @@ -35,11 +45,12 @@ const handleClick = function () {
- {{ modelValue == true ? activeText : inactiveText }} + {{ isActive == true ? activeText : inactiveText }}