From 3ccb51c4c6278690f8d471e82e65e3c14fcbd4fa Mon Sep 17 00:00:00 2001 From: rex Date: Mon, 18 Nov 2019 21:13:25 +0800 Subject: [PATCH] perf(Rate): remove unreachable code (#2332) --- example/pages/rate/index.wxml | 2 +- packages/rate/index.ts | 14 ++------------ packages/rate/index.wxml | 2 +- 3 files changed, 4 insertions(+), 14 deletions(-) diff --git a/example/pages/rate/index.wxml b/example/pages/rate/index.wxml index 86cd3d7f..4feb979d 100644 --- a/example/pages/rate/index.wxml +++ b/example/pages/rate/index.wxml @@ -21,7 +21,7 @@ custom-class="van-rate" data-key="value3" value="{{ value3 }}" - size="{{ 250 }}" + size="{{ 25 }}" color="#ee0a24" void-color="#eee" void-icon="star" diff --git a/packages/rate/index.ts b/packages/rate/index.ts index b58c6f9e..19229639 100644 --- a/packages/rate/index.ts +++ b/packages/rate/index.ts @@ -12,10 +12,7 @@ VantComponent({ readonly: Boolean, disabled: Boolean, allowHalf: Boolean, - size: { - type: null, - observer: 'setSizeWithUnit' - }, + size: null, icon: { type: String, value: 'star' @@ -52,8 +49,7 @@ VantComponent({ data: { innerValue: 0, - gutterWithUnit: undefined, - sizeWithUnit: '20px' + gutterWithUnit: undefined }, watch: { @@ -65,12 +61,6 @@ VantComponent({ }, methods: { - setSizeWithUnit(val) { - this.setData({ - sizeWithUnit: addUnit(val) - }); - }, - setGutterWithUnit(val) { this.setData({ gutterWithUnit: addUnit(val) diff --git a/packages/rate/index.wxml b/packages/rate/index.wxml index 5b3dc065..9d48ef79 100644 --- a/packages/rate/index.wxml +++ b/packages/rate/index.wxml @@ -8,7 +8,7 @@ class="van-rate__item" wx:for="{{ count }}" wx:key="index" - style="font-size: {{ sizeWithUnit }};padding-right: {{ index !== count - 1 ? gutterWithUnit : '' }}" + style="padding-right: {{ index !== count - 1 ? gutterWithUnit : '' }}" >