From 665515fcaef186a04b45f1c8f2173e8c4b8b04c8 Mon Sep 17 00:00:00 2001 From: "tianhaoyun@didiglobal.com" Date: Wed, 15 Jan 2025 16:54:32 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- example/common/config.ts | 6 ++--- example/pages/rate/index.mpx | 11 +++++--- jest.config.js | 3 +-- package.json | 2 +- .../src/components/loading/index.mpx | 2 +- .../src/components/loading/index.ts | 2 +- .../mpx-cube-ui/src/components/rate/index.mpx | 2 +- .../mpx-cube-ui/src/components/rate/index.ts | 27 ++++++------------- .../src/components/rate/rate-item-index.ts | 4 --- .../src/components/switch/index.ts | 4 +-- pnpm-lock.yaml | 2 +- 11 files changed, 25 insertions(+), 40 deletions(-) diff --git a/example/common/config.ts b/example/common/config.ts index 7741906..3e96aa0 100644 --- a/example/common/config.ts +++ b/example/common/config.ts @@ -41,8 +41,6 @@ export default { 'icon', 'divider', 'float-ball', - 'rate', - 'switch', 'loading' ] }, @@ -57,7 +55,9 @@ export default { 'picker', 'cascade-picker', 'date-picker', - 'time-picker' + 'time-picker', + 'rate', + 'switch' ] }, { diff --git a/example/pages/rate/index.mpx b/example/pages/rate/index.mpx index e2a8fd0..c7ff8ed 100644 --- a/example/pages/rate/index.mpx +++ b/example/pages/rate/index.mpx @@ -58,7 +58,7 @@ @@ -71,7 +71,7 @@ createPage({ data: { - value: 4.5, + value: 3.3, max: '5', customize: false, justify: false, @@ -92,9 +92,9 @@ updateMaxLength (e) { const { value } = e.detail this.max = value - if (value >= 10) { + if (value > 9) { this.$refs.toast.show() - this.max = '10' + this.max = '9' } }, updateJustify (e) { @@ -156,6 +156,9 @@ .cube-rate-item_active .rate-item-demo background-color: orange +.cube-rate-item_half_active + .rate-item-demo + background-color: blue