From 43a15cab5a384be278d13376a84d1fb62c115a30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=98=89=E6=B6=B5?= Date: Fri, 20 Sep 2019 14:15:06 +0800 Subject: [PATCH] build: compile 1.0.0-beta.0 --- dist/action-sheet/index.js | 11 ++ dist/action-sheet/index.wxml | 2 +- dist/action-sheet/index.wxss | 2 +- dist/area/index.js | 10 +- dist/badge-group/index.wxml | 3 - dist/badge-group/index.wxss | 1 - dist/badge/index.wxml | 17 --- dist/badge/index.wxss | 1 - dist/button/index.js | 32 ++++- dist/button/index.wxml | 5 +- dist/button/index.wxss | 2 +- dist/card/index.wxss | 2 +- dist/cell-group/index.wxss | 2 +- dist/cell/index.wxss | 2 +- dist/checkbox-group/index.js | 2 +- dist/checkbox/index.js | 15 +- dist/checkbox/index.wxml | 5 +- dist/checkbox/index.wxss | 2 +- dist/{badge-group => circle}/index.d.ts | 0 dist/circle/index.js | 158 +++++++++++++++++++++ dist/{badge-group => circle}/index.json | 0 dist/circle/index.wxml | 7 + dist/circle/index.wxss | 1 + dist/col/index.js | 2 +- dist/collapse-item/index.js | 4 +- dist/collapse-item/index.wxss | 2 +- dist/common/color.d.ts | 4 + dist/common/color.js | 4 + dist/common/component.d.ts | 4 +- dist/common/index.wxss | 2 +- dist/common/style/clearfix.wxss | 2 +- dist/common/style/ellipsis.wxss | 2 +- dist/common/style/hairline.wxss | 2 +- dist/common/style/theme.wxss | 0 dist/common/utils.d.ts | 3 + dist/common/utils.js | 14 ++ dist/datetime-picker/index.js | 26 ++-- dist/definitions/index.d.ts | 10 +- dist/definitions/weapp.d.ts | 17 +-- dist/dialog/dialog.js | 4 +- dist/dialog/index.js | 16 ++- dist/dialog/index.wxml | 9 +- dist/dialog/index.wxss | 2 +- dist/{badge => divider}/index.d.ts | 0 dist/divider/index.js | 33 +++++ dist/divider/index.json | 4 + dist/divider/index.wxml | 8 ++ dist/divider/index.wxss | 1 + dist/field/index.js | 55 ++------ dist/field/index.wxml | 20 +-- dist/field/index.wxss | 2 +- dist/goods-action-button/index.js | 1 + dist/goods-action-button/index.wxml | 1 + dist/goods-action-icon/index.wxml | 2 + dist/goods-action-icon/index.wxss | 2 +- dist/goods-action/index.wxss | 2 +- dist/grid-item/index.d.ts | 1 + dist/grid-item/index.js | 54 ++++++++ dist/grid-item/index.json | 6 + dist/grid-item/index.wxml | 19 +++ dist/grid-item/index.wxss | 1 + dist/grid/index.d.ts | 1 + dist/grid/index.js | 61 ++++++++ {lib/badge-group => dist/grid}/index.json | 0 dist/grid/index.wxml | 3 + dist/grid/index.wxss | 1 + dist/icon/index.js | 24 +++- dist/icon/index.wxml | 11 +- dist/icon/index.wxss | 2 +- dist/info/index.js | 1 + dist/info/index.wxml | 8 +- dist/info/index.wxss | 2 +- dist/loading/index.js | 13 +- dist/loading/index.wxml | 4 +- dist/loading/index.wxss | 2 +- dist/mixins/observer/behavior.js | 47 +------ dist/mixins/observer/index.js | 10 +- dist/mixins/observer/props.d.ts | 1 - dist/mixins/observer/props.js | 22 --- dist/mixins/safe-area.js | 2 +- dist/mixins/transition.js | 12 +- dist/nav-bar/index.js | 2 +- dist/nav-bar/index.wxss | 2 +- dist/notice-bar/index.js | 8 +- dist/notice-bar/index.wxml | 4 +- dist/notice-bar/index.wxss | 2 +- dist/notify/index.js | 32 +++-- dist/notify/index.wxml | 9 +- dist/notify/index.wxss | 2 +- dist/notify/notify.d.ts | 12 +- dist/notify/notify.js | 17 ++- dist/overlay/index.js | 3 +- dist/overlay/index.wxml | 2 +- dist/overlay/index.wxss | 2 +- dist/panel/index.wxss | 2 +- dist/picker-column/index.js | 37 ++--- dist/picker-column/index.wxml | 2 +- dist/picker-column/index.wxss | 2 +- dist/picker/index.js | 5 +- dist/picker/index.wxml | 7 +- dist/picker/index.wxss | 2 +- dist/popup/index.js | 19 ++- dist/popup/index.json | 1 + dist/popup/index.wxml | 12 +- dist/popup/index.wxss | 2 +- dist/progress/index.js | 15 ++ dist/progress/index.wxml | 2 +- dist/progress/index.wxss | 2 +- dist/radio-group/index.js | 2 +- dist/radio/index.js | 13 ++ dist/radio/index.wxml | 6 +- dist/radio/index.wxss | 2 +- dist/rate/index.js | 36 ++++- dist/rate/index.wxml | 2 +- dist/rate/index.wxss | 2 +- dist/row/index.js | 2 +- dist/row/index.wxss | 2 +- dist/search/index.js | 17 ++- dist/search/index.wxml | 10 +- dist/search/index.wxss | 2 +- dist/sidebar-item/index.d.ts | 1 + dist/{badge => sidebar-item}/index.js | 7 +- dist/{badge => sidebar-item}/index.json | 0 dist/sidebar-item/index.wxml | 18 +++ dist/sidebar-item/index.wxss | 1 + dist/sidebar/index.d.ts | 1 + dist/{badge-group => sidebar}/index.js | 20 +-- dist/sidebar/index.json | 3 + dist/sidebar/index.wxml | 3 + dist/sidebar/index.wxss | 1 + dist/slider/index.js | 26 +++- dist/slider/index.wxss | 2 +- dist/stepper/index.js | 97 +++++++++---- dist/stepper/index.wxml | 22 ++- dist/stepper/index.wxss | 2 +- dist/steps/index.js | 7 +- dist/steps/index.wxml | 8 +- dist/steps/index.wxss | 2 +- dist/sticky/index.d.ts | 1 + dist/sticky/index.js | 109 +++++++++++++++ dist/sticky/index.json | 3 + dist/sticky/index.wxml | 5 + dist/sticky/index.wxss | 1 + dist/submit-bar/index.js | 4 +- dist/submit-bar/index.wxss | 2 +- dist/swipe-cell/index.js | 16 ++- dist/switch/index.js | 12 +- dist/switch/index.wxml | 2 +- dist/switch/index.wxss | 2 +- dist/tabbar-item/index.js | 6 +- dist/tabbar-item/index.wxss | 2 +- dist/tabbar/index.js | 2 +- dist/tabbar/index.wxss | 2 +- dist/tabs/index.js | 37 +++-- dist/tabs/index.wxss | 2 +- dist/tag/index.js | 23 +--- dist/tag/index.wxml | 4 +- dist/tag/index.wxss | 2 +- dist/toast/index.wxml | 2 +- dist/toast/index.wxss | 2 +- dist/toast/toast.js | 6 +- dist/transition/index.wxss | 2 +- dist/tree-select/index.js | 19 ++- dist/tree-select/index.wxml | 24 +--- dist/tree-select/index.wxs | 12 ++ dist/tree-select/index.wxss | 2 +- dist/wxs/utils.wxs | 5 - lib/action-sheet/index.js | 11 ++ lib/action-sheet/index.wxml | 2 +- lib/action-sheet/index.wxss | 2 +- lib/area/index.js | 10 +- lib/badge-group/index.wxml | 3 - lib/badge-group/index.wxss | 1 - lib/badge/index.wxml | 17 --- lib/badge/index.wxss | 1 - lib/button/index.js | 32 ++++- lib/button/index.wxml | 5 +- lib/button/index.wxss | 2 +- lib/card/index.wxss | 2 +- lib/cell-group/index.wxss | 2 +- lib/cell/index.wxss | 2 +- lib/checkbox-group/index.js | 2 +- lib/checkbox/index.js | 15 +- lib/checkbox/index.wxml | 5 +- lib/checkbox/index.wxss | 2 +- lib/circle/index.js | 161 ++++++++++++++++++++++ lib/circle/index.json | 3 + lib/circle/index.wxml | 7 + lib/circle/index.wxss | 1 + lib/col/index.js | 2 +- lib/collapse-item/index.js | 4 +- lib/collapse-item/index.wxss | 2 +- lib/common/color.js | 4 + lib/common/index.wxss | 2 +- lib/common/style/clearfix.wxss | 2 +- lib/common/style/ellipsis.wxss | 2 +- lib/common/style/hairline.wxss | 2 +- lib/common/style/theme.wxss | 0 lib/common/utils.js | 16 +++ lib/datetime-picker/index.js | 33 +++-- lib/dialog/dialog.js | 4 +- lib/dialog/index.js | 16 ++- lib/dialog/index.wxml | 9 +- lib/dialog/index.wxss | 2 +- lib/divider/index.js | 35 +++++ lib/divider/index.json | 4 + lib/divider/index.wxml | 8 ++ lib/divider/index.wxss | 1 + lib/field/index.js | 56 ++------ lib/field/index.wxml | 20 +-- lib/field/index.wxss | 2 +- lib/goods-action-button/index.js | 1 + lib/goods-action-button/index.wxml | 1 + lib/goods-action-icon/index.wxml | 2 + lib/goods-action-icon/index.wxss | 2 +- lib/goods-action/index.wxss | 2 +- lib/grid-item/index.js | 56 ++++++++ lib/grid-item/index.json | 6 + lib/grid-item/index.wxml | 19 +++ lib/grid-item/index.wxss | 1 + lib/grid/index.js | 63 +++++++++ lib/grid/index.json | 3 + lib/grid/index.wxml | 3 + lib/grid/index.wxss | 1 + lib/icon/index.js | 24 +++- lib/icon/index.wxml | 11 +- lib/icon/index.wxss | 2 +- lib/info/index.js | 1 + lib/info/index.wxml | 8 +- lib/info/index.wxss | 2 +- lib/loading/index.js | 13 +- lib/loading/index.wxml | 4 +- lib/loading/index.wxss | 2 +- lib/mixins/observer/behavior.js | 48 +------ lib/mixins/observer/index.js | 20 +-- lib/mixins/observer/props.js | 29 ---- lib/mixins/safe-area.js | 2 +- lib/mixins/transition.js | 12 +- lib/nav-bar/index.js | 2 +- lib/nav-bar/index.wxss | 2 +- lib/notice-bar/index.js | 8 +- lib/notice-bar/index.wxml | 4 +- lib/notice-bar/index.wxss | 2 +- lib/notify/index.js | 30 ++-- lib/notify/index.wxml | 9 +- lib/notify/index.wxss | 2 +- lib/notify/notify.js | 17 ++- lib/overlay/index.js | 3 +- lib/overlay/index.wxml | 2 +- lib/overlay/index.wxss | 2 +- lib/panel/index.wxss | 2 +- lib/picker-column/index.js | 37 ++--- lib/picker-column/index.wxml | 2 +- lib/picker-column/index.wxss | 2 +- lib/picker/index.js | 5 +- lib/picker/index.wxml | 7 +- lib/picker/index.wxss | 2 +- lib/popup/index.js | 19 ++- lib/popup/index.json | 1 + lib/popup/index.wxml | 12 +- lib/popup/index.wxss | 2 +- lib/progress/index.js | 15 ++ lib/progress/index.wxml | 2 +- lib/progress/index.wxss | 2 +- lib/radio-group/index.js | 2 +- lib/radio/index.js | 13 ++ lib/radio/index.wxml | 6 +- lib/radio/index.wxss | 2 +- lib/rate/index.js | 36 ++++- lib/rate/index.wxml | 2 +- lib/rate/index.wxss | 2 +- lib/row/index.js | 2 +- lib/row/index.wxss | 2 +- lib/search/index.js | 17 ++- lib/search/index.wxml | 10 +- lib/search/index.wxss | 2 +- lib/{badge => sidebar-item}/index.js | 7 +- lib/{badge => sidebar-item}/index.json | 0 lib/sidebar-item/index.wxml | 18 +++ lib/sidebar-item/index.wxss | 1 + lib/{badge-group => sidebar}/index.js | 20 +-- lib/sidebar/index.json | 3 + lib/sidebar/index.wxml | 3 + lib/sidebar/index.wxss | 1 + lib/slider/index.js | 26 +++- lib/slider/index.wxss | 2 +- lib/stepper/index.js | 99 +++++++++---- lib/stepper/index.wxml | 22 ++- lib/stepper/index.wxss | 2 +- lib/steps/index.js | 7 +- lib/steps/index.wxml | 8 +- lib/steps/index.wxss | 2 +- lib/sticky/index.js | 108 +++++++++++++++ lib/sticky/index.json | 3 + lib/sticky/index.wxml | 5 + lib/sticky/index.wxss | 1 + lib/submit-bar/index.js | 4 +- lib/submit-bar/index.wxss | 2 +- lib/swipe-cell/index.js | 115 ++++++++++++++++ lib/swipe-cell/index.json | 3 + lib/swipe-cell/index.wxml | 20 +++ lib/swipe-cell/index.wxss | 1 + lib/switch/index.js | 12 +- lib/switch/index.wxml | 2 +- lib/switch/index.wxss | 2 +- lib/tabbar-item/index.js | 6 +- lib/tabbar-item/index.wxss | 2 +- lib/tabbar/index.js | 2 +- lib/tabbar/index.wxss | 2 +- lib/tabs/index.js | 27 ++-- lib/tabs/index.wxss | 2 +- lib/tag/index.js | 24 +--- lib/tag/index.wxml | 4 +- lib/tag/index.wxss | 2 +- lib/toast/index.wxml | 2 +- lib/toast/index.wxss | 2 +- lib/toast/toast.js | 6 +- lib/transition/index.wxss | 2 +- lib/tree-select/index.js | 19 ++- lib/tree-select/index.wxml | 24 +--- lib/tree-select/index.wxs | 12 ++ lib/tree-select/index.wxss | 2 +- lib/wxs/utils.wxs | 5 - 323 files changed, 2509 insertions(+), 961 deletions(-) delete mode 100644 dist/badge-group/index.wxml delete mode 100644 dist/badge-group/index.wxss delete mode 100644 dist/badge/index.wxml delete mode 100644 dist/badge/index.wxss rename dist/{badge-group => circle}/index.d.ts (100%) create mode 100644 dist/circle/index.js rename dist/{badge-group => circle}/index.json (100%) create mode 100644 dist/circle/index.wxml create mode 100644 dist/circle/index.wxss create mode 100644 dist/common/style/theme.wxss rename dist/{badge => divider}/index.d.ts (100%) create mode 100644 dist/divider/index.js create mode 100644 dist/divider/index.json create mode 100644 dist/divider/index.wxml create mode 100644 dist/divider/index.wxss create mode 100644 dist/grid-item/index.d.ts create mode 100644 dist/grid-item/index.js create mode 100644 dist/grid-item/index.json create mode 100644 dist/grid-item/index.wxml create mode 100644 dist/grid-item/index.wxss create mode 100644 dist/grid/index.d.ts create mode 100644 dist/grid/index.js rename {lib/badge-group => dist/grid}/index.json (100%) create mode 100644 dist/grid/index.wxml create mode 100644 dist/grid/index.wxss delete mode 100644 dist/mixins/observer/props.d.ts delete mode 100644 dist/mixins/observer/props.js create mode 100644 dist/sidebar-item/index.d.ts rename dist/{badge => sidebar-item}/index.js (80%) rename dist/{badge => sidebar-item}/index.json (100%) create mode 100644 dist/sidebar-item/index.wxml create mode 100644 dist/sidebar-item/index.wxss create mode 100644 dist/sidebar/index.d.ts rename dist/{badge-group => sidebar}/index.js (60%) create mode 100644 dist/sidebar/index.json create mode 100644 dist/sidebar/index.wxml create mode 100644 dist/sidebar/index.wxss create mode 100644 dist/sticky/index.d.ts create mode 100644 dist/sticky/index.js create mode 100644 dist/sticky/index.json create mode 100644 dist/sticky/index.wxml create mode 100644 dist/sticky/index.wxss create mode 100644 dist/tree-select/index.wxs delete mode 100644 lib/badge-group/index.wxml delete mode 100644 lib/badge-group/index.wxss delete mode 100644 lib/badge/index.wxml delete mode 100644 lib/badge/index.wxss create mode 100644 lib/circle/index.js create mode 100644 lib/circle/index.json create mode 100644 lib/circle/index.wxml create mode 100644 lib/circle/index.wxss create mode 100644 lib/common/style/theme.wxss create mode 100644 lib/divider/index.js create mode 100644 lib/divider/index.json create mode 100644 lib/divider/index.wxml create mode 100644 lib/divider/index.wxss create mode 100644 lib/grid-item/index.js create mode 100644 lib/grid-item/index.json create mode 100644 lib/grid-item/index.wxml create mode 100644 lib/grid-item/index.wxss create mode 100644 lib/grid/index.js create mode 100644 lib/grid/index.json create mode 100644 lib/grid/index.wxml create mode 100644 lib/grid/index.wxss delete mode 100644 lib/mixins/observer/props.js rename lib/{badge => sidebar-item}/index.js (83%) rename lib/{badge => sidebar-item}/index.json (100%) create mode 100644 lib/sidebar-item/index.wxml create mode 100644 lib/sidebar-item/index.wxss rename lib/{badge-group => sidebar}/index.js (62%) create mode 100644 lib/sidebar/index.json create mode 100644 lib/sidebar/index.wxml create mode 100644 lib/sidebar/index.wxss create mode 100644 lib/sticky/index.js create mode 100644 lib/sticky/index.json create mode 100644 lib/sticky/index.wxml create mode 100644 lib/sticky/index.wxss create mode 100644 lib/swipe-cell/index.js create mode 100644 lib/swipe-cell/index.json create mode 100644 lib/swipe-cell/index.wxml create mode 100644 lib/swipe-cell/index.wxss create mode 100644 lib/tree-select/index.wxs diff --git a/dist/action-sheet/index.js b/dist/action-sheet/index.js index 225b463a..49b4e96b 100644 --- a/dist/action-sheet/index.js +++ b/dist/action-sheet/index.js @@ -21,6 +21,10 @@ VantComponent({ closeOnClickOverlay: { type: Boolean, value: true + }, + closeOnClickAction: { + type: Boolean, + value: true } }, methods: { @@ -29,6 +33,9 @@ VantComponent({ const item = this.data.actions[index]; if (item && !item.disabled && !item.loading) { this.$emit('select', item); + if (this.data.closeOnClickAction) { + this.onClose(); + } } }, onCancel() { @@ -36,6 +43,10 @@ VantComponent({ }, onClose() { this.$emit('close'); + }, + onClickOverlay() { + this.$emit('click-overlay'); + this.onClose(); } } }); diff --git a/dist/action-sheet/index.wxml b/dist/action-sheet/index.wxml index 5f6d33f8..2ddb8635 100644 --- a/dist/action-sheet/index.wxml +++ b/dist/action-sheet/index.wxml @@ -8,7 +8,7 @@ custom-class="van-action-sheet" safe-area-inset-bottom="{{ safeAreaInsetBottom }}" close-on-click-overlay="{{ closeOnClickOverlay }}" - bind:close="onClose" + bind:close="onClickOverlay" > {{ title }} diff --git a/dist/action-sheet/index.wxss b/dist/action-sheet/index.wxss index a3087b1b..f88ad2a8 100644 --- a/dist/action-sheet/index.wxss +++ b/dist/action-sheet/index.wxss @@ -1 +1 @@ -@import '../common/index.wxss';.van-action-sheet{max-height:90%!important;color:#333}.van-action-sheet__cancel,.van-action-sheet__item{height:50px;font-size:16px;line-height:50px;text-align:center;background-color:#fff}.van-action-sheet__cancel--hover,.van-action-sheet__item--hover{background-color:#f2f3f5}.van-action-sheet__cancel{height:60px}.van-action-sheet__cancel:before{display:block;height:10px;background-color:#f8f8f8;content:" "}.van-action-sheet__item--disabled{color:#c9c9c9}.van-action-sheet__item--disabled.van-action-sheet__item--hover{background-color:#fff}.van-action-sheet__subname{margin-left:5px;font-size:12px;color:#7d7e80}.van-action-sheet__header{font-size:16px;font-weight:500;line-height:44px;text-align:center}.van-action-sheet__close{position:absolute!important;top:0;right:0;padding:0 15px;font-size:18px!important;line-height:inherit!important;color:#999} \ No newline at end of file +@import '../common/index.wxss';.van-action-sheet{max-height:90%!important;color:#333;color:var(--text-color,#333)}.van-action-sheet__cancel,.van-action-sheet__item{height:50px;font-size:16px;line-height:50px;text-align:center;background-color:#fff;background-color:var(--white,#fff)}.van-action-sheet__cancel--hover,.van-action-sheet__item--hover{background-color:#f2f3f5;background-color:var(--active-color,#f2f3f5)}.van-action-sheet__cancel{height:60px}.van-action-sheet__cancel:before{display:block;height:10px;content:" ";background-color:#f8f8f8;background-color:var(--background-color,#f8f8f8)}.van-action-sheet__item--disabled{color:#c9c9c9;color:var(--gray,#c9c9c9)}.van-action-sheet__item--disabled.van-action-sheet__item--hover{background-color:#fff;background-color:var(--white,#fff)}.van-action-sheet__subname{margin-left:5px;font-size:12px;color:#7d7e80;color:var(--gray-darker,#7d7e80)}.van-action-sheet__header{font-weight:500;font-size:16px;line-height:44px;text-align:center}.van-action-sheet__close{position:absolute!important;top:0;right:0;padding:0 15px;font-size:18px!important;line-height:inherit!important;color:#999;color:var(--gray-dark,#999)} \ No newline at end of file diff --git a/dist/area/index.js b/dist/area/index.js index 03aa598d..ac8bbadb 100644 --- a/dist/area/index.js +++ b/dist/area/index.js @@ -2,11 +2,11 @@ import { VantComponent } from '../common/component'; import { pickerProps } from '../picker/shared'; VantComponent({ classes: ['active-class', 'toolbar-class', 'column-class'], - props: Object.assign({}, pickerProps, { value: String, areaList: { + props: Object.assign(Object.assign({}, pickerProps), { value: String, areaList: { type: Object, value: {} }, columnsNum: { - type: [String, Number], + type: null, value: 3 } }), data: { @@ -20,7 +20,7 @@ VantComponent({ }, areaList: 'setValues', columnsNum(value) { - this.set({ + this.setData({ displayColumns: this.data.columns.slice(0, +value) }); } @@ -151,8 +151,8 @@ VantComponent({ } return area; }, - reset() { - this.code = ''; + reset(code) { + this.code = code || ''; return this.setValues(); } } diff --git a/dist/badge-group/index.wxml b/dist/badge-group/index.wxml deleted file mode 100644 index 04a0c8f3..00000000 --- a/dist/badge-group/index.wxml +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/dist/badge-group/index.wxss b/dist/badge-group/index.wxss deleted file mode 100644 index 5149eabf..00000000 --- a/dist/badge-group/index.wxss +++ /dev/null @@ -1 +0,0 @@ -@import '../common/index.wxss';.van-badge-group{width:85px} \ No newline at end of file diff --git a/dist/badge/index.wxml b/dist/badge/index.wxml deleted file mode 100644 index 3563bdbf..00000000 --- a/dist/badge/index.wxml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - {{ title }} - - diff --git a/dist/badge/index.wxss b/dist/badge/index.wxss deleted file mode 100644 index cf5ff09c..00000000 --- a/dist/badge/index.wxss +++ /dev/null @@ -1 +0,0 @@ -@import '../common/index.wxss';.van-badge{display:block;padding:20px 12px 20px 9px;overflow:hidden;font-size:14px;line-height:1.4;color:#7d7e80;word-break:break-all;background-color:#f8f8f8;border-left:3px solid transparent;box-sizing:border-box;-webkit-user-select:none;user-select:none}.van-badge--hover{background-color:#f2f3f5}.van-badge:after{border-bottom-width:1px}.van-badge--active{font-weight:700;color:#333;border-color:#ee0a24}.van-badge--active:after{border-right-width:1px}.van-badge--active,.van-badge--active.van-badge--hover{background-color:#fff}.van-badge__text{position:relative} \ No newline at end of file diff --git a/dist/button/index.js b/dist/button/index.js index c7deb502..e32509e8 100644 --- a/dist/button/index.js +++ b/dist/button/index.js @@ -4,9 +4,11 @@ import { openType } from '../mixins/open-type'; VantComponent({ mixins: [button, openType], classes: ['hover-class', 'loading-class'], + data: { + style: '' + }, props: { icon: String, - color: String, plain: Boolean, block: Boolean, round: Boolean, @@ -15,6 +17,11 @@ VantComponent({ hairline: Boolean, disabled: Boolean, loadingText: String, + customStyle: String, + loadingType: { + type: String, + value: 'circular' + }, type: { type: String, value: 'default' @@ -26,6 +33,29 @@ VantComponent({ loadingSize: { type: String, value: '20px' + }, + color: { + type: String, + observer(color) { + let style = ''; + if (color) { + style += `color: ${this.data.plain ? color : 'white'};`; + if (!this.data.plain) { + // Use background instead of backgroundColor to make linear-gradient work + style += `background: ${color};`; + } + // hide border when color is linear-gradient + if (color.indexOf('gradient') !== -1) { + style += 'border: 0;'; + } + else { + style += `border-color: ${color};`; + } + } + if (style !== this.data.style) { + this.setData({ style }); + } + } } }, methods: { diff --git a/dist/button/index.wxml b/dist/button/index.wxml index dec0e7d5..639e0f15 100644 --- a/dist/button/index.wxml +++ b/dist/button/index.wxml @@ -3,10 +3,10 @@