From 438d97eca3b426f96689fba76c9bb0885afde8bd Mon Sep 17 00:00:00 2001 From: Waiter Date: Fri, 14 Feb 2020 14:35:38 +0800 Subject: [PATCH] chore: change some names (#2757) --- packages/button/index.ts | 6 +++--- packages/button/index.wxml | 4 ++-- packages/col/index.ts | 8 ++++---- packages/col/index.wxml | 2 +- packages/grid-item/index.ts | 6 +++++- packages/grid-item/index.wxml | 2 +- packages/grid/index.ts | 6 +++++- packages/grid/index.wxml | 2 +- packages/image/index.ts | 5 +++-- packages/image/index.wxml | 2 +- packages/loading/index.ts | 6 +++++- packages/loading/index.wxml | 2 +- packages/notify/index.ts | 4 ++++ packages/row/index.ts | 8 ++++++-- packages/row/index.wxml | 2 +- 15 files changed, 43 insertions(+), 22 deletions(-) diff --git a/packages/button/index.ts b/packages/button/index.ts index 7bc675fa..a3dfefa4 100644 --- a/packages/button/index.ts +++ b/packages/button/index.ts @@ -8,7 +8,7 @@ VantComponent({ classes: ['hover-class', 'loading-class'], data: { - style: '' + baseStyle: '' }, props: { @@ -59,8 +59,8 @@ VantComponent({ } } - if (style !== this.data.style) { - this.setData({ style }); + if (style !== this.data.baseStyle) { + this.setData({ baseStyle: style }); } } } diff --git a/packages/button/index.wxml b/packages/button/index.wxml index 162010a5..3239354f 100644 --- a/packages/button/index.wxml +++ b/packages/button/index.wxml @@ -5,7 +5,7 @@ class="custom-class {{ utils.bem('button', [type, size, { block, round, plain, square, loading, disabled, hairline, unclickable: disabled || loading }]) }} {{ hairline ? 'van-hairline--surround' : '' }}" hover-class="van-button--active hover-class" lang="{{ lang }}" - style="{{ style }} {{ customStyle }}" + style="{{ baseStyle }} {{ customStyle }}" open-type="{{ openType }}" business-id="{{ businessId }}" session-from="{{ sessionFrom }}" @@ -65,4 +65,4 @@ function get(type, color,plain) { } module.exports = get; - \ No newline at end of file + diff --git a/packages/col/index.ts b/packages/col/index.ts index b4258b7d..4bd77ec3 100644 --- a/packages/col/index.ts +++ b/packages/col/index.ts @@ -12,16 +12,16 @@ VantComponent({ }, data: { - style: '' + viewStyle: '' }, methods: { setGutter(gutter: number) { const padding = `${gutter / 2}px`; - const style = gutter ? `padding-left: ${padding}; padding-right: ${padding};` : ''; + const viewStyle = gutter ? `padding-left: ${padding}; padding-right: ${padding};` : ''; - if (style !== this.data.style) { - this.setData({ style }); + if (viewStyle !== this.data.viewStyle) { + this.setData({ viewStyle }); } } } diff --git a/packages/col/index.wxml b/packages/col/index.wxml index a759aac5..52544f09 100644 --- a/packages/col/index.wxml +++ b/packages/col/index.wxml @@ -2,7 +2,7 @@ diff --git a/packages/grid-item/index.ts b/packages/grid-item/index.ts index f666a571..ee2d2d22 100644 --- a/packages/grid-item/index.ts +++ b/packages/grid-item/index.ts @@ -21,6 +21,10 @@ VantComponent({ useSlot: Boolean }, + data: { + viewStyle: '', + }, + mounted() { this.updateStyle(); }, @@ -65,7 +69,7 @@ VantComponent({ } this.setData({ - style: styleWrapper.join('; '), + viewStyle: styleWrapper.join('; '), contentStyle, center, border, diff --git a/packages/grid-item/index.wxml b/packages/grid-item/index.wxml index 2fb189b8..23b61c19 100644 --- a/packages/grid-item/index.wxml +++ b/packages/grid-item/index.wxml @@ -1,6 +1,6 @@ - + + diff --git a/packages/image/index.ts b/packages/image/index.ts index f5a27ed6..243ba712 100644 --- a/packages/image/index.ts +++ b/packages/image/index.ts @@ -56,7 +56,8 @@ VantComponent({ data: { error: false, - loading: true + loading: true, + viewStyle: '', }, mounted() { @@ -88,7 +89,7 @@ VantComponent({ style += `border-radius: ${addUnit(radius)};`; } - this.setData({ style }); + this.setData({ viewStyle: style }); }, onLoad(event) { diff --git a/packages/image/index.wxml b/packages/image/index.wxml index 4724ca22..6450ba14 100644 --- a/packages/image/index.wxml +++ b/packages/image/index.wxml @@ -1,7 +1,7 @@ diff --git a/packages/loading/index.ts b/packages/loading/index.ts index 9a29f29d..9b555fc2 100644 --- a/packages/loading/index.ts +++ b/packages/loading/index.ts @@ -10,5 +10,9 @@ VantComponent({ }, size: String, textSize: String - } + }, + + data: { + array12: Array.from({ length: 12 }), + }, }); diff --git a/packages/loading/index.wxml b/packages/loading/index.wxml index 25016e55..e934288b 100644 --- a/packages/loading/index.wxml +++ b/packages/loading/index.wxml @@ -7,7 +7,7 @@ > diff --git a/packages/notify/index.ts b/packages/notify/index.ts index 95eda3b3..dc4e6495 100644 --- a/packages/notify/index.ts +++ b/packages/notify/index.ts @@ -29,6 +29,10 @@ VantComponent({ } }, + data: { + show: false, + }, + created() { const { statusBarHeight } = wx.getSystemInfoSync(); this.setData({ statusBarHeight }); diff --git a/packages/row/index.ts b/packages/row/index.ts index fe0cf39d..7d964d67 100644 --- a/packages/row/index.ts +++ b/packages/row/index.ts @@ -18,6 +18,10 @@ VantComponent({ } }, + data: { + viewStyle: '', + }, + mounted() { if (this.data.gutter) { this.setGutter(); @@ -28,11 +32,11 @@ VantComponent({ setGutter() { const { gutter } = this.data; const margin = `-${Number(gutter) / 2}px`; - const style = gutter + const viewStyle = gutter ? `margin-right: ${margin}; margin-left: ${margin};` : ''; - this.setData({ style }); + this.setData({ viewStyle }); this.getRelationNodes('../col/index').forEach(col => { col.setGutter(this.data.gutter); }); diff --git a/packages/row/index.wxml b/packages/row/index.wxml index 20c53661..ab8fcf58 100644 --- a/packages/row/index.wxml +++ b/packages/row/index.wxml @@ -1,3 +1,3 @@ - +