From 1078ad54a04ebd57c6fb119e023f56d8a1ecafca Mon Sep 17 00:00:00 2001 From: yaogengzhu <455947455@qq.com> Date: Sat, 29 Jul 2023 22:16:19 +0800 Subject: [PATCH 1/3] fix: fixed invalid clearable property --- src/range-input/range-input.tsx | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/range-input/range-input.tsx b/src/range-input/range-input.tsx index 395c00e7a..cd4a51953 100644 --- a/src/range-input/range-input.tsx +++ b/src/range-input/range-input.tsx @@ -40,7 +40,9 @@ export default defineComponent({ const [innerValue, setInnerValue] = useVModel(value, props.defaultValue, props.onChange, 'change'); const isShowClearIcon = computed( - () => ((props.clearable && props.value?.length && !props.disabled) || props.showClearIconOnEmpty) && isHover.value, + () => ((props.clearable && (innerValue.value[0] || innerValue.value[1]) && !props.disabled) + || props.showClearIconOnEmpty) + && isHover.value, ); const inputRefs = { @@ -49,6 +51,7 @@ export default defineComponent({ }; function handleClear(context: { e: MouseEvent }) { + setInnerValue(['', '']); props.onClear?.(context); } @@ -239,15 +242,13 @@ export default defineComponent({ {...{ props: calcInputProps[1] }} /> {suffixContent ?
{suffixContent}
: null} - {suffixIconContent && ( - - {isShowClearIcon ? ( - - ) : ( - suffixIconContent - )} - - )} + + {isShowClearIcon ? ( + + ) : ( + suffixIconContent + )} + {tips &&
{tips}
} From 56334d248b0980cc1d32f5315c4f7cf10f8aaf92 Mon Sep 17 00:00:00 2001 From: yaogengzhu <455947455@qq.com> Date: Tue, 1 Aug 2023 15:01:48 +0800 Subject: [PATCH 2/3] test: update snap --- test/snap/__snapshots__/csr.test.js.snap | 24 ++++++++++++++++++++++++ test/snap/__snapshots__/ssr.test.js.snap | 10 +++++----- 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/test/snap/__snapshots__/csr.test.js.snap b/test/snap/__snapshots__/csr.test.js.snap index b2c06149b..246a5e9cd 100644 --- a/test/snap/__snapshots__/csr.test.js.snap +++ b/test/snap/__snapshots__/csr.test.js.snap @@ -82039,6 +82039,9 @@ exports[`csr snapshot test > csr test ./src/range-input/_example/base.vue 1`] = /> + `; @@ -82088,6 +82091,9 @@ exports[`csr snapshot test > csr test ./src/range-input/_example/popup.vue 1`] = /> + @@ -82142,6 +82148,9 @@ exports[`csr snapshot test > csr test ./src/range-input/_example/size.vue 1`] = /> + @@ -82189,6 +82198,9 @@ exports[`csr snapshot test > csr test ./src/range-input/_example/size.vue 1`] = /> + @@ -82236,6 +82248,9 @@ exports[`csr snapshot test > csr test ./src/range-input/_example/size.vue 1`] = /> + @@ -82291,6 +82306,9 @@ exports[`csr snapshot test > csr test ./src/range-input/_example/status.vue 1`] /> + @@ -82338,6 +82356,9 @@ exports[`csr snapshot test > csr test ./src/range-input/_example/status.vue 1`] /> + @@ -82385,6 +82406,9 @@ exports[`csr snapshot test > csr test ./src/range-input/_example/status.vue 1`] /> + diff --git a/test/snap/__snapshots__/ssr.test.js.snap b/test/snap/__snapshots__/ssr.test.js.snap index baaa3d4c7..84c75b3e5 100644 --- a/test/snap/__snapshots__/ssr.test.js.snap +++ b/test/snap/__snapshots__/ssr.test.js.snap @@ -773,13 +773,13 @@ exports[`ssr snapshot test > renders ./src/radio/_example/size.vue correctly 1`] exports[`ssr snapshot test > renders ./src/radio/_example/type.vue correctly 1`] = `"
边框型单选按钮
填充型单选按钮
"`; -exports[`ssr snapshot test > renders ./src/range-input/_example/base.vue correctly 1`] = `"
-
"`; +exports[`ssr snapshot test > renders ./src/range-input/_example/base.vue correctly 1`] = `"
-
"`; -exports[`ssr snapshot test > renders ./src/range-input/_example/popup.vue correctly 1`] = `"
-
"`; +exports[`ssr snapshot test > renders ./src/range-input/_example/popup.vue correctly 1`] = `"
-
"`; -exports[`ssr snapshot test > renders ./src/range-input/_example/size.vue correctly 1`] = `"
-
-
-
"`; +exports[`ssr snapshot test > renders ./src/range-input/_example/size.vue correctly 1`] = `"
-
-
-
"`; -exports[`ssr snapshot test > renders ./src/range-input/_example/status.vue correctly 1`] = `"
-
-
-
"`; +exports[`ssr snapshot test > renders ./src/range-input/_example/status.vue correctly 1`] = `"
-
-
-
"`; exports[`ssr snapshot test > renders ./src/rate/_example/base.vue correctly 1`] = `"
"`; @@ -1014,7 +1014,7 @@ exports[`ssr snapshot test > renders ./src/table/_example/multiple-sort.vue corr exports[`ssr snapshot test > renders ./src/table/_example/pagination.vue correctly 1`] = `"
序号
申请人
申请状态
签署方式
申请时间
6王芳审批过期纸质签署2022-02-01
7贾明审批通过电子签署2022-03-01
8张三审批失败纸质签署2022-04-01
9王芳审批过期纸质签署2022-01-01
10贾明审批通过电子签署2022-02-01
共 59 项数据
5 条/页
  • 1
  • 2
  • 3
  • 4
  • 5
  • 12
跳至
/ 12 页
"`; -exports[`ssr snapshot test > renders ./src/table/_example/pagination-ajax.vue correctly 1`] = `"
申请人
申请状态
联系方式
邮箱
共 0 项数据
10 条/页
  • 1
跳至
/ 1 页
"`; +exports[`ssr snapshot test > renders ./src/table/_example/pagination-ajax.vue correctly 1`] = `"
申请人
申请状态
联系方式
邮箱
共 0 项数据
10 条/页
  • 1
跳至
/ 1 页
"`; exports[`ssr snapshot test > renders ./src/table/_example/select-multiple.vue correctly 1`] = `"
申请人
申请状态
签署方式
邮箱地址
申请时间
贾明审批通过电子签署
w.cezkdudy@lhll.au
2022-01-01
张三审批失败纸质签署
r.nmgw@peurezgn.sl
2022-02-01
王芳审批过期纸质签署
p.cumx@rampblpa.ru
2022-03-01
贾明审批通过电子签署
w.cezkdudy@lhll.au
2022-04-01
张三审批失败纸质签署
r.nmgw@peurezgn.sl
2022-01-01
"`; From e9bb73fb0bfb68eb6ddac82156375b4259c70f2c Mon Sep 17 00:00:00 2001 From: yaogengzhu <455947455@qq.com> Date: Tue, 1 Aug 2023 15:26:53 +0800 Subject: [PATCH 3/3] test: update snap --- .../__snapshots__/vitest-guide.test.jsx.snap | 380 ++++++++++++++++-- 1 file changed, 351 insertions(+), 29 deletions(-) diff --git a/src/guide/__tests__/__snapshots__/vitest-guide.test.jsx.snap b/src/guide/__tests__/__snapshots__/vitest-guide.test.jsx.snap index 079118be5..bb6703b82 100644 --- a/src/guide/__tests__/__snapshots__/vitest-guide.test.jsx.snap +++ b/src/guide/__tests__/__snapshots__/vitest-guide.test.jsx.snap @@ -2536,7 +2536,7 @@ exports[`Guide Component > GuideStep.body works fine 1`] = ` -
+
GuideStep.body works fine 1`] = `
- +
GuideStep.body works fine 1`] = ` + > +
+
+
+
+ 新手引导标题 +
+
+ 新手引导的说明文案 +
+ +
+
+
+
+
GuideStep.content works fine 1`] = `
-
+
GuideStep.content works fine 1`] = `
- +
GuideStep.content works fine 1`] = ` + > +
+
+
+
+ 新手引导标题 +
+
+ + TNode + +
+ +
+
+
+
+
GuideStep.highlightContent works fine 1`] = `
-
+
GuideStep.highlightContent works fine 1`] = `
- +
GuideStep.highlightContent works fine 1`] = ` + > +
+
+ + TNode + +
+
+
+
GuideStep.placement is equal to bottom-left 1`] = `
-
+
GuideStep.placement is equal to bottom-left 1`] = `
- +
GuideStep.stepOverlayClass is equal to t-test-guide-s
-
+
GuideStep.stepOverlayClass is equal to t-test-guide-s
- +
GuideStep.title works fine 1`] = `
-
+
GuideStep.title works fine 1`] = `
- +
slots.body works fine 1`] = `
-
+
slots.body works fine 1`] = `
- +
slots.body works fine 1`] = ` + > +
+
+
+
+ 新手引导标题 +
+
+ + TNode + +
+ +
+
+
+
+
slots.content works fine 1`] = `
-
+
slots.content works fine 1`] = `
- +
slots.content works fine 1`] = ` + > +
+
+ + TNode + +
+
+
slots.highlight-content works fine 1`] = `
-
+
slots.highlight-content works fine 1`] = `
- +
slots.highlight-content works fine 1`] = ` + > +
+
+
+
+ 新手引导标题 +
+
+ 新手引导的说明文案 +
+ +
+
+
+
+
slots.highlightContent works fine 1`] = `
-
+
slots.highlightContent works fine 1`] = `
- +
slots.highlightContent works fine 1`] = ` + > +
+
+
+
+ 新手引导标题 +
+
+ 新手引导的说明文案 +
+ +
+
+
+
+
slots.title works fine 1`] = `
-
+
slots.title works fine 1`] = `
- +