diff --git a/build/build-components.js b/build/build-components.js
index 7e0fd05e..7dbcf8ed 100644
--- a/build/build-components.js
+++ b/build/build-components.js
@@ -1,5 +1,5 @@
const path = require('path');
-const extracter = require('./utils/extracter');
+const extracter = require('./extracter');
extracter({
src: path.resolve(__dirname, '../packages'),
diff --git a/build/webpack.dev.js b/build/webpack.dev.js
index c87dc20b..02c5d964 100644
--- a/build/webpack.dev.js
+++ b/build/webpack.dev.js
@@ -6,7 +6,8 @@ const { VueLoaderPlugin } = require('vue-loader');
module.exports = {
mode: 'development',
entry: {
- 'vant-docs': './docs/src/index.js'
+ 'vant-docs': './docs/src/index.js',
+ 'vant-preview': './docs/src/preview.js'
},
output: {
path: path.join(__dirname, '../docs/dist'),
@@ -82,6 +83,12 @@ module.exports = {
template: 'docs/src/index.tpl',
filename: 'index.html',
inject: true
+ }),
+ new HtmlWebpackPlugin({
+ chunks: ['vant-preview'],
+ template: 'docs/src/index.tpl',
+ filename: 'preview.html',
+ inject: true
})
]
};
diff --git a/dist/button/behaviors.js b/dist/button/behaviors.js
index 903e7bf2..b0e8bf3b 100644
--- a/dist/button/behaviors.js
+++ b/dist/button/behaviors.js
@@ -37,39 +37,29 @@ module.exports = Behavior({
methods: {
bindgetuserinfo: function bindgetuserinfo() {
- var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
- _ref$detail = _ref.detail,
- detail = _ref$detail === undefined ? {} : _ref$detail;
+ var event = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- this.triggerEvent('getuserinfo', detail);
+ this.triggerEvent('getuserinfo', event.detail || {});
},
bindcontact: function bindcontact() {
- var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
- _ref2$detail = _ref2.detail,
- detail = _ref2$detail === undefined ? {} : _ref2$detail;
+ var event = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- this.triggerEvent('contact', detail);
+ this.triggerEvent('contact', event.detail || {});
},
bindgetphonenumber: function bindgetphonenumber() {
- var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
- _ref3$detail = _ref3.detail,
- detail = _ref3$detail === undefined ? {} : _ref3$detail;
+ var event = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- this.triggerEvent('getphonenumber', detail);
+ this.triggerEvent('getphonenumber', event.detail || {});
},
bindopensetting: function bindopensetting() {
- var _ref4 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
- _ref4$detail = _ref4.detail,
- detail = _ref4$detail === undefined ? {} : _ref4$detail;
+ var event = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- this.triggerEvent('opensetting', detail);
+ this.triggerEvent('opensetting', event.detail || {});
},
binderror: function binderror() {
- var _ref5 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
- _ref5$detail = _ref5.detail,
- detail = _ref5$detail === undefined ? {} : _ref5$detail;
+ var event = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- this.triggerEvent('error', detail);
+ this.triggerEvent('error', event.detail || {});
}
}
});
\ No newline at end of file
diff --git a/dist/card/index.wxss b/dist/card/index.wxss
index 33980063..7e5e97b7 100644
--- a/dist/card/index.wxss
+++ b/dist/card/index.wxss
@@ -1 +1 @@
-.van-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.van-clearfix::after{content:'';display:table;clear:both}.van-hairline,.van-hairline--bottom,.van-hairline--left,.van-hairline--right,.van-hairline--surround,.van-hairline--top,.van-hairline--top-bottom{position:relative}.van-hairline--bottom::after,.van-hairline--left::after,.van-hairline--right::after,.van-hairline--surround::after,.van-hairline--top-bottom::after,.van-hairline--top::after,.van-hairline::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;-webkit-transform:scale(.5);transform:scale(.5);-webkit-transform-origin:0 0;transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e5e5e5}.van-hairline--top::after{border-top-width:1px}.van-hairline--left::after{border-left-width:1px}.van-hairline--right::after{border-right-width:1px}.van-hairline--bottom::after{border-bottom-width:1px}.van-hairline--top-bottom::after{border-width:1px 0}.van-hairline--surround::after{border-width:1px}@-webkit-keyframes van-slide-bottom-enter{from{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@keyframes van-slide-bottom-enter{from{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@-webkit-keyframes van-slide-bottom-leave{to{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@keyframes van-slide-bottom-leave{to{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@-webkit-keyframes van-fade-in{from{opacity:0}to{opacity:1}}@keyframes van-fade-in{from{opacity:0}to{opacity:1}}@-webkit-keyframes van-fade-out{from{opacity:1}to{opacity:0}}@keyframes van-fade-out{from{opacity:1}to{opacity:0}}@-webkit-keyframes van-rotate{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes van-rotate{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.van-fade-enter-active{-webkit-animation:.3s van-fade-in;animation:.3s van-fade-in}.van-fade-leave-active{-webkit-animation:.3s van-fade-out;animation:.3s van-fade-out}.van-slide-bottom-enter-active{-webkit-animation:van-slide-bottom-enter .3s both ease;animation:van-slide-bottom-enter .3s both ease}.van-slide-bottom-leave-active{-webkit-animation:van-slide-bottom-leave .3s both ease;animation:van-slide-bottom-leave .3s both ease}.van-card{color:#333;height:100px;font-size:16px;background:#fafafa;position:relative;box-sizing:border-box;padding:5px 15px 5px 115px}.van-card--center,.van-card__thumb{-webkit-box-align:center;align-items:center;-webkit-box-pack:center;justify-content:center}.van-card__thumb{top:5px;left:15px;width:90px;height:90px;position:absolute}.van-card__img{border:none;max-width:100%;max-height:100%}.van-card,.van-card__row,.van-card__thumb{display:-webkit-box;display:flex}.van-card__content{width:100%}.van-card__content--center{height:90px;-webkit-box-align:center;align-items:center}.van-card__desc,.van-card__title{line-height:20px;word-break:break-all}.van-card__title{max-height:40px;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.van-card__desc{color:#666;font-size:12px;max-height:20px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.van-card__num,.van-card__price{-webkit-box-flex:1;flex:1;min-width:80px;line-height:20px;text-align:right}.van-card__price{font-size:14px}.van-card__num{color:#666;font-size:12px}.van-card__footer{right:15px;bottom:5px;position:absolute}.van-card__footer .van-button{margin-left:5px}
\ No newline at end of file
+.van-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.van-clearfix::after{content:'';display:table;clear:both}.van-hairline,.van-hairline--bottom,.van-hairline--left,.van-hairline--right,.van-hairline--surround,.van-hairline--top,.van-hairline--top-bottom{position:relative}.van-hairline--bottom::after,.van-hairline--left::after,.van-hairline--right::after,.van-hairline--surround::after,.van-hairline--top-bottom::after,.van-hairline--top::after,.van-hairline::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;-webkit-transform:scale(.5);transform:scale(.5);-webkit-transform-origin:0 0;transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e5e5e5}.van-hairline--top::after{border-top-width:1px}.van-hairline--left::after{border-left-width:1px}.van-hairline--right::after{border-right-width:1px}.van-hairline--bottom::after{border-bottom-width:1px}.van-hairline--top-bottom::after{border-width:1px 0}.van-hairline--surround::after{border-width:1px}@-webkit-keyframes van-slide-bottom-enter{from{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@keyframes van-slide-bottom-enter{from{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@-webkit-keyframes van-slide-bottom-leave{to{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@keyframes van-slide-bottom-leave{to{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@-webkit-keyframes van-fade-in{from{opacity:0}to{opacity:1}}@keyframes van-fade-in{from{opacity:0}to{opacity:1}}@-webkit-keyframes van-fade-out{from{opacity:1}to{opacity:0}}@keyframes van-fade-out{from{opacity:1}to{opacity:0}}@-webkit-keyframes van-rotate{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes van-rotate{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.van-fade-enter-active{-webkit-animation:.3s van-fade-in;animation:.3s van-fade-in}.van-fade-leave-active{-webkit-animation:.3s van-fade-out;animation:.3s van-fade-out}.van-slide-bottom-enter-active{-webkit-animation:van-slide-bottom-enter .3s both ease;animation:van-slide-bottom-enter .3s both ease}.van-slide-bottom-leave-active{-webkit-animation:van-slide-bottom-leave .3s both ease;animation:van-slide-bottom-leave .3s both ease}.van-card{color:#333;height:100px;font-size:16px;background:#fafafa;position:relative;box-sizing:border-box;padding:5px 15px 5px 115px}.van-card--center,.van-card__thumb{-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center}.van-card__thumb{top:5px;left:15px;width:90px;height:90px;position:absolute}.van-card__img{border:none;max-width:100%;max-height:100%}.van-card,.van-card__row,.van-card__thumb{display:-webkit-box;display:-webkit-flex;display:flex}.van-card__content{width:100%}.van-card__content--center{height:90px;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.van-card__desc,.van-card__title{line-height:20px;word-break:break-all}.van-card__title{max-height:40px;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.van-card__desc{color:#666;font-size:12px;max-height:20px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.van-card__num,.van-card__price{-webkit-box-flex:1;-webkit-flex:1;flex:1;min-width:80px;line-height:20px;text-align:right}.van-card__price{font-size:14px}.van-card__num{color:#666;font-size:12px}.van-card__footer{right:15px;bottom:5px;position:absolute}.van-card__footer .van-button{margin-left:5px}
\ No newline at end of file
diff --git a/dist/cell/index.wxss b/dist/cell/index.wxss
index 418b61c1..c382a7fa 100644
--- a/dist/cell/index.wxss
+++ b/dist/cell/index.wxss
@@ -1 +1 @@
-.van-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.van-clearfix::after{content:'';display:table;clear:both}.van-hairline,.van-hairline--bottom,.van-hairline--left,.van-hairline--right,.van-hairline--surround,.van-hairline--top,.van-hairline--top-bottom{position:relative}.van-hairline--bottom::after,.van-hairline--left::after,.van-hairline--right::after,.van-hairline--surround::after,.van-hairline--top-bottom::after,.van-hairline--top::after,.van-hairline::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;-webkit-transform:scale(.5);transform:scale(.5);-webkit-transform-origin:0 0;transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e5e5e5}.van-hairline--top::after{border-top-width:1px}.van-hairline--left::after{border-left-width:1px}.van-hairline--right::after{border-right-width:1px}.van-hairline--bottom::after{border-bottom-width:1px}.van-hairline--top-bottom::after{border-width:1px 0}.van-hairline--surround::after{border-width:1px}@-webkit-keyframes van-slide-bottom-enter{from{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@keyframes van-slide-bottom-enter{from{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@-webkit-keyframes van-slide-bottom-leave{to{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@keyframes van-slide-bottom-leave{to{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@-webkit-keyframes van-fade-in{from{opacity:0}to{opacity:1}}@keyframes van-fade-in{from{opacity:0}to{opacity:1}}@-webkit-keyframes van-fade-out{from{opacity:1}to{opacity:0}}@keyframes van-fade-out{from{opacity:1}to{opacity:0}}@-webkit-keyframes van-rotate{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes van-rotate{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.van-fade-enter-active{-webkit-animation:.3s van-fade-in;animation:.3s van-fade-in}.van-fade-leave-active{-webkit-animation:.3s van-fade-out;animation:.3s van-fade-out}.van-slide-bottom-enter-active{-webkit-animation:van-slide-bottom-enter .3s both ease;animation:van-slide-bottom-enter .3s both ease}.van-slide-bottom-leave-active{-webkit-animation:van-slide-bottom-leave .3s both ease;animation:van-slide-bottom-leave .3s both ease}.van-cell{width:100%;display:-webkit-box;display:flex;padding:10px 15px;box-sizing:border-box;line-height:24px;position:relative;background-color:#fff;color:#333;font-size:14px}.van-cell::after{left:15px;right:0;width:auto;-webkit-transform:scale(1,.5);transform:scale(1,.5);border-bottom-width:1px}.van-cell-group{background-color:#fff}.van-cell__label{font-size:12px;line-height:1.2;color:#666}.van-cell__title,.van-cell__value{-webkit-box-flex:1;flex:1}.van-cell__value{overflow:hidden;text-align:right;vertical-align:middle}.van-cell__left-icon{font-size:16px;line-height:24px;margin-right:5px;vertical-align:middle}.van-cell__right-icon{color:#999;font-size:12px;line-height:24px;margin-left:5px}.van-cell__right-icon--left::before{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.van-cell__right-icon--up::before{-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.van-cell__right-icon--down::before{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.van-cell--tapable:active{background-color:#e8e8e8}.van-cell--required{overflow:visible}.van-cell--required::before{content:'*';position:absolute;left:7px;font-size:14px;color:#f44}.van-cell--center{-webkit-box-align:center;align-items:center}
\ No newline at end of file
+.van-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.van-clearfix::after{content:'';display:table;clear:both}.van-hairline,.van-hairline--bottom,.van-hairline--left,.van-hairline--right,.van-hairline--surround,.van-hairline--top,.van-hairline--top-bottom{position:relative}.van-hairline--bottom::after,.van-hairline--left::after,.van-hairline--right::after,.van-hairline--surround::after,.van-hairline--top-bottom::after,.van-hairline--top::after,.van-hairline::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;-webkit-transform:scale(.5);transform:scale(.5);-webkit-transform-origin:0 0;transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e5e5e5}.van-hairline--top::after{border-top-width:1px}.van-hairline--left::after{border-left-width:1px}.van-hairline--right::after{border-right-width:1px}.van-hairline--bottom::after{border-bottom-width:1px}.van-hairline--top-bottom::after{border-width:1px 0}.van-hairline--surround::after{border-width:1px}@-webkit-keyframes van-slide-bottom-enter{from{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@keyframes van-slide-bottom-enter{from{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@-webkit-keyframes van-slide-bottom-leave{to{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@keyframes van-slide-bottom-leave{to{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@-webkit-keyframes van-fade-in{from{opacity:0}to{opacity:1}}@keyframes van-fade-in{from{opacity:0}to{opacity:1}}@-webkit-keyframes van-fade-out{from{opacity:1}to{opacity:0}}@keyframes van-fade-out{from{opacity:1}to{opacity:0}}@-webkit-keyframes van-rotate{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes van-rotate{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.van-fade-enter-active{-webkit-animation:.3s van-fade-in;animation:.3s van-fade-in}.van-fade-leave-active{-webkit-animation:.3s van-fade-out;animation:.3s van-fade-out}.van-slide-bottom-enter-active{-webkit-animation:van-slide-bottom-enter .3s both ease;animation:van-slide-bottom-enter .3s both ease}.van-slide-bottom-leave-active{-webkit-animation:van-slide-bottom-leave .3s both ease;animation:van-slide-bottom-leave .3s both ease}.van-cell{width:100%;display:-webkit-box;display:-webkit-flex;display:flex;padding:10px 15px;box-sizing:border-box;line-height:24px;position:relative;background-color:#fff;color:#333;font-size:14px}.van-cell::after{left:15px;right:0;width:auto;-webkit-transform:scale(1,.5);transform:scale(1,.5);border-bottom-width:1px}.van-cell-group{background-color:#fff}.van-cell__label{font-size:12px;line-height:1.2;color:#666}.van-cell__title,.van-cell__value{-webkit-box-flex:1;-webkit-flex:1;flex:1}.van-cell__value{overflow:hidden;text-align:right;vertical-align:middle}.van-cell__left-icon{font-size:16px;line-height:24px;margin-right:5px;vertical-align:middle}.van-cell__right-icon{color:#999;font-size:12px;line-height:24px;margin-left:5px}.van-cell__right-icon--left::before{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.van-cell__right-icon--up::before{-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.van-cell__right-icon--down::before{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.van-cell--tapable:active{background-color:#e8e8e8}.van-cell--required{overflow:visible}.van-cell--required::before{content:'*';position:absolute;left:7px;font-size:14px;color:#f44}.van-cell--center{-webkit-box-align:center;-webkit-align-items:center;align-items:center}
\ No newline at end of file
diff --git a/dist/checkbox-group/index.js b/dist/checkbox-group/index.js
deleted file mode 100644
index 09058960..00000000
--- a/dist/checkbox-group/index.js
+++ /dev/null
@@ -1,29 +0,0 @@
-'use strict';
-
-var _relations;
-
-var CHECKBOX_PATH = '../checkbox/index';
-
-Component({
- relations: (_relations = {}, _relations[CHECKBOX_PATH] = {
- type: 'child',
- linked: function linked() {
- this.updateChildren(CHECKBOX_PATH);
- }
- }, _relations),
-
- data: {
- elementUpdateTimeout: 0
- },
-
- methods: {
- updateChildren: function updateChildren(childPath) {
- // 把checkbox标记为在group中,设置不同样式
- var elements = this.getRelationNodes(childPath);
-
- elements.forEach(function (checkbox, index) {
- checkbox.updateData({ isInGroup: true });
- });
- }
- }
-});
\ No newline at end of file
diff --git a/dist/checkbox-group/index.json b/dist/checkbox-group/index.json
deleted file mode 100644
index 32640e0d..00000000
--- a/dist/checkbox-group/index.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "component": true
-}
\ No newline at end of file
diff --git a/dist/checkbox-group/index.wxml b/dist/checkbox-group/index.wxml
deleted file mode 100644
index a6ef51f8..00000000
--- a/dist/checkbox-group/index.wxml
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
diff --git a/dist/checkbox-group/index.wxss b/dist/checkbox-group/index.wxss
deleted file mode 100644
index 418d8711..00000000
--- a/dist/checkbox-group/index.wxss
+++ /dev/null
@@ -1 +0,0 @@
-.checkbox-group{padding-bottom:10px;background-color:#fff}.checkbox-group .van-checkbox{margin-top:10px}
\ No newline at end of file
diff --git a/dist/checkbox/index.js b/dist/checkbox/index.js
deleted file mode 100644
index 62160c07..00000000
--- a/dist/checkbox/index.js
+++ /dev/null
@@ -1,44 +0,0 @@
-'use strict';
-
-var _relations;
-
-var CHECKBOX_GROUP_PATH = '../checkbox-group/index';
-
-Component({
- externalClasses: ['checkbox-class'],
- relations: (_relations = {}, _relations[CHECKBOX_GROUP_PATH] = {
- type: 'parent'
- }, _relations),
-
- properties: {
- checked: Boolean,
- disabled: Boolean,
- isInGroup: Boolean,
- labelDisabled: Boolean,
- type: String
- },
-
- data: function data() {
- return {
- isInGroup: false,
- isInCell: false
- };
- },
-
-
- methods: {
- handleClick: function handleClick() {
- if (this.data.disabled) {
- return;
- }
-
- var checked = !this.data.checked;
-
- this.triggerEvent('change', checked);
- this.setData({ checked: checked });
- },
- updateData: function updateData(data) {
- this.setData(data);
- }
- }
-});
\ No newline at end of file
diff --git a/dist/checkbox/index.json b/dist/checkbox/index.json
deleted file mode 100644
index 0a336c08..00000000
--- a/dist/checkbox/index.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "component": true,
- "usingComponents": {
- "van-icon": "../icon/index"
- }
-}
diff --git a/dist/checkbox/index.wxml b/dist/checkbox/index.wxml
deleted file mode 100644
index 311ccbb9..00000000
--- a/dist/checkbox/index.wxml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
diff --git a/dist/checkbox/index.wxss b/dist/checkbox/index.wxss
deleted file mode 100644
index b56cf0a8..00000000
--- a/dist/checkbox/index.wxss
+++ /dev/null
@@ -1 +0,0 @@
-.van-checkbox{display:inline-block;padding:0 10px;font-size:14px}.van-checkbox__item{display:block;margin-top:10px}.van-checkbox__list-item{display:block;padding:10px 10px 10px 0;margin-left:10px;border-bottom:1px solid #e5e5e5}.van-checkbox__list-item .van-checkbox__icon{float:right}.van-checkbox__icon{display:-webkit-inline-box;display:inline-flex;-webkit-box-align:center;align-items:center;color:#aaa}.van-checkbox__icon.van-checkbox--checked{color:#06bf04}.van-checkbox__icon.van-checkbox--disabled{color:#e5e5e5}.van-checkbox__label{display:inline-block;margin-left:10px}
\ No newline at end of file
diff --git a/dist/common/helper.js b/dist/common/helper.js
deleted file mode 100644
index e995325d..00000000
--- a/dist/common/helper.js
+++ /dev/null
@@ -1,102 +0,0 @@
-'use strict';
-
-// 从事件对象中解析得到 componentId
-// 需要在元素上声明 data-component-id
-function extractComponentId() {
- var event = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
-
- var _ref = event.currentTarget || {},
- componentId = _ref.dataset.componentId;
-
- return componentId;
-}
-
-/*
- 注:默认合并所有生命周期函数
- 配置合并指定的生命周期 or 忽略指定字段
- const extend = extendCreator({
- life: ['onLoad', 'onPullDownRefresh'],
- exclude: ['binder']
- });
-
- Page(extend({}, {
- onLoad() {},
- ...
- }));
-*/
-
-var LIFE_CYCLE = ['onLoad', 'onReady', 'onShow', 'onHide', 'onUnload', 'onPullDownRefresh', 'onReachBottom', 'onShareAppMessage', 'onPageScroll'];
-
-var extendCreator = function extendCreator() {
- var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- var _config$life = config.life,
- life = _config$life === undefined ? LIFE_CYCLE : _config$life,
- _config$exclude = config.exclude,
- exclude = _config$exclude === undefined ? [] : _config$exclude;
-
-
- var excludeList = exclude.concat(LIFE_CYCLE.map(getFuncArrayName));
-
- if (!Array.isArray(life) || !Array.isArray(exclude)) throw new Error('Invalid Extend Config');
- var lifeCycleList = life.filter(function (item) {
- return LIFE_CYCLE.indexOf(item) >= 0;
- });
- return function extend(target) {
- for (var _len = arguments.length, objList = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
- objList[_key - 1] = arguments[_key];
- }
-
- objList.forEach(function (source) {
- if (source) {
- var keys = Object.keys(source);
- keys.forEach(function (key) {
- var value = source[key];
- if (excludeList.indexOf(key) >= 0) return;
- if (lifeCycleList.indexOf(key) >= 0 && typeof value === 'function') {
- var funcArrayName = getFuncArrayName(key);
- if (!target[funcArrayName]) {
- target[funcArrayName] = [];
- if (target[key]) {
- target[funcArrayName].push(target[key]);
- }
- target[key] = function () {
- var _this = this;
-
- for (var _len2 = arguments.length, rest = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
- rest[_key2] = arguments[_key2];
- }
-
- target[funcArrayName].forEach(function (func) {
- return func.apply(_this, rest);
- });
- };
- }
-
- if (source[funcArrayName]) {
- var _target$funcArrayName;
-
- // 经过生命周期合并的组件直接整合函数列表
- (_target$funcArrayName = target[funcArrayName]).push.apply(_target$funcArrayName, source[funcArrayName]);
- } else {
- // 添加生命周期函数进入函数列表
- target[funcArrayName].push(value);
- }
- } else {
- target[key] = value;
- }
- });
- }
- });
- return target;
- };
-};
-
-var getFuncArrayName = function getFuncArrayName(name) {
- return '__$' + name;
-};
-
-module.exports = {
- extractComponentId: extractComponentId,
- extend: Object.assign,
- extendCreator: extendCreator
-};
\ No newline at end of file
diff --git a/dist/datetime-picker/date-picker-view.wxml b/dist/datetime-picker/date-picker-view.wxml
deleted file mode 100644
index 0a69f841..00000000
--- a/dist/datetime-picker/date-picker-view.wxml
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/dist/datetime-picker/date-picker.js b/dist/datetime-picker/date-picker.js
deleted file mode 100644
index 309ba6eb..00000000
--- a/dist/datetime-picker/date-picker.js
+++ /dev/null
@@ -1,105 +0,0 @@
-'use strict';
-
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
-var LIMIT_YEAR_COUNT = 50;
-
-var _require = require('./utils'),
- genNumber = _require.genNumber,
- iso2utc = _require.iso2utc;
-
-module.exports = function () {
- function DatePicker() {
- var date = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new Date();
-
- _classCallCheck(this, DatePicker);
-
- this.types = ['year', 'month', 'day', 'hour', 'minute', 'second'];
- this.months = genNumber(1, 12, 2);
- this.hours = genNumber(0, 23, 2);
- this.seconds = genNumber(0, 59, 2);
- this.minutes = genNumber(0, 59, 2);
- this._date = date;
- }
-
- DatePicker.prototype.getYears = function getYears(year) {
- var mid = Math.floor(LIMIT_YEAR_COUNT / 2);
- var min = year - mid;
- var max = year + (LIMIT_YEAR_COUNT - mid);
- return genNumber(min, max, 4);
- };
-
- DatePicker.prototype.lastDay = function lastDay(year, month) {
- return month !== 12 ? new Date(new Date(year + '/' + (month + 1) + '/1').getTime() - 24 * 60 * 60 * 1000).getDate() : 31;
- };
-
- DatePicker.prototype.getData = function getData(date) {
- date = date || this._date || new Date();
-
- // toUTCString ISO 格式部分 ios 手机会失败
- if (new Date(date).toString() === 'Invalid Date' && typeof date === 'string' && date.indexOf('-') > 0) {
- date = iso2utc(date);
- }
-
- var d = new Date(date);
-
- var y = d.getFullYear();
- var m = d.getMonth() + 1;
- var years = this.getYears(y);
- var lastDay = this.lastDay(y, m);
- var days = genNumber(1, lastDay, 2);
-
- this._years = years;
- this._dataList = [years, this.months, days, this.hours, this.minutes, this.seconds];
- this._indexs = [25, m - 1, d.getDate() - 1, d.getHours(), d.getMinutes(), d.getSeconds()];
-
- return {
- dataList: this._dataList,
- selected: this._indexs
- };
- };
-
- DatePicker.prototype.update = function update(col, index) {
- var type = this.types[col];
- switch (type) {
- case 'year':
- return this._updateYear(col, index);
- case 'month':
- return this._updateMonth(col, index);
- default:
- this._indexs[col] = index;
- return [{ col: col, index: index }];
- }
- };
-
- DatePicker.prototype._updateYear = function _updateYear(col, index, cb) {
- var years = this._dataList[col];
- var year = years[index];
-
- this._dataList[col] = this.getYears(+year);
-
- this._indexs[col] = Math.floor(LIMIT_YEAR_COUNT / 2);
-
- return [{ col: 0, index: this._indexs[col], data: this._dataList[col] }];
- };
-
- DatePicker.prototype._updateMonth = function _updateMonth(col, index) {
- var month = this._dataList[col][index];
- var year = this._dataList[0][this._indexs[0]];
- var lastDay = this.lastDay(+year, +month);
- this._indexs[col] = index;
- this._dataList[2] = genNumber(1, lastDay, 2);
- this._indexs[2] = this._indexs[2] >= this._dataList[2].length ? this._dataList[2].length - 1 : this._indexs[2];
-
- return [{
- col: 1,
- index: index
- }, {
- col: 2,
- index: this._indexs[2],
- data: this._dataList[2]
- }];
- };
-
- return DatePicker;
-}();
\ No newline at end of file
diff --git a/dist/datetime-picker/index.js b/dist/datetime-picker/index.js
deleted file mode 100644
index 44246df0..00000000
--- a/dist/datetime-picker/index.js
+++ /dev/null
@@ -1,216 +0,0 @@
-'use strict';
-
-var DatePicker = require('./date-picker');
-
-var _require = require('./utils'),
- genNumber = _require.genNumber,
- moment = _require.moment;
-
-Component({
- properties: {
- placeholder: {
- type: String,
- value: '请选择时间'
- },
- format: {
- type: String,
- value: 'YYYY-MM-DD HH:mm:ss'
- },
- pickerView: {
- type: Boolean
- },
- date: {
- type: String,
- observer: function observer(value) {
- if (value === {}.toString()) {
- throw new Error('参数必须是一个字符串');
- }
- if (/^[0-9]+$/.test(value)) {
- value = +value;
- }
- !this._inited && this._init();
- this.updateDate(value);
- }
- },
- notUse: {
- type: Array
- }
- },
- externalClasses: ['placeholder-class'],
- data: {
- transPos: [0, 0, 0, 0, 0, 0]
- },
- attached: function attached() {
- !this._inited && this._init();
- },
-
-
- methods: {
- _init: function _init() {
- var _this = this;
-
- this._inited = true;
- this.use = {};
-
- ['years', 'months', 'days', 'hours', 'minutes', 'seconds'].forEach(function (item) {
- if ((_this.data.notUse || []).indexOf(item) === -1) {
- _this.use[item] = true;
- }
- });
-
- this.picker = new DatePicker(this.data.date);
-
- var _picker$getData = this.picker.getData(this.data.date),
- dataList = _picker$getData.dataList,
- selected = _picker$getData.selected;
-
- // 鬼他么知道为什么 dataList, selected 不能一起 setData
-
-
- this.setData({
- use: this.use,
- dataList: dataList
- }, function () {
- _this.setData({
- selected: selected
- });
- });
-
- this._indexs = selected;
- },
- updatePicker: function updatePicker() {
- var updateData = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
-
- var _updateData = {};
-
- for (var _iterator = updateData, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
- var _ref2;
-
- if (_isArray) {
- if (_i >= _iterator.length) break;
- _ref2 = _iterator[_i++];
- } else {
- _i = _iterator.next();
- if (_i.done) break;
- _ref2 = _i.value;
- }
-
- var _ref = _ref2;
- var col = _ref.col,
- index = _ref.index,
- data = _ref.data;
-
- if (~index && this._indexs[col] !== index || col === 0) {
- _updateData['selected[' + col + ']'] = index; // 更新索引
- this._indexs[col] = index;
- }
-
- if (data) {
- _updateData['dataList[' + col + ']'] = data;
- }
- }
-
- this.setData(_updateData);
- },
- updateDate: function updateDate(date) {
- var _this2 = this;
-
- var _picker$getData2 = this.picker.getData(date),
- dataList = _picker$getData2.dataList,
- selected = _picker$getData2.selected;
-
- this._indexs = selected;
-
- // 好像必须要等到 datalist 完成
- this.setData({ dataList: dataList }, function () {
- _this2.setData({
- selected: selected,
- text: _this2.getFormatStr()
- });
- });
- },
- getFormatStr: function getFormatStr() {
- var _this3 = this;
-
- var date = new Date();
- ['FullYear', 'Month', 'Date', 'Hours', 'Minutes', 'Seconds'].forEach(function (key, index) {
- var value = _this3.data.dataList[index][_this3._indexs[index]];
- if (key === 'Month') {
- value = +_this3.data.dataList[index][_this3._indexs[index]] - 1;
- }
- date['set' + key](+value);
- });
-
- return moment(date, this.data.format);
- },
- showPicker: function showPicker() {
- this.setData({
- show: true
- });
- },
- hidePicker: function hidePicker(e) {
- var action = e.currentTarget.dataset.action;
-
-
- this.setData({
- show: false
- });
-
- if (action === 'cancel') {
- this.cancel({
- detail: {}
- });
- } else {
- this.change({
- detail: {
- value: this._indexs
- }
- });
- }
- },
- columnchange: function columnchange(e) {
- var _e$detail = e.detail,
- column = _e$detail.column,
- value = _e$detail.value;
-
- var updateData = this.picker.update(column, value);
- this.updatePicker(updateData);
- },
- change: function change(e) {
- var value = e.detail.value;
-
-
- var data = this.data.dataList.map(function (item, index) {
- return +item[value[index]];
- });
-
- var day = data.slice(0, 3);
- var time = data.slice(3, 6);
- var date = new Date(day.join('/') + ' ' + time.join(':'));
-
- this.triggerEvent('change', {
- value: data,
- date: date
- });
-
- // 手动触发 columnchange
- for (var index = 0; index < value.length; index++) {
- if (this._indexs[index] !== value[index]) {
- this.columnchange({
- detail: {
- column: index,
- value: value[index]
- }
- });
- }
- }
-
- this.setData({
- text: this.getFormatStr()
- });
- },
- cancel: function cancel(e) {
- this.triggerEvent('cancel', e.detail);
- }
- }
-});
\ No newline at end of file
diff --git a/dist/datetime-picker/index.json b/dist/datetime-picker/index.json
deleted file mode 100644
index 10d4a702..00000000
--- a/dist/datetime-picker/index.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "component": true,
- "usingComponents": {
- "pop-manager": "../common/pop-manager/index"
- }
-}
\ No newline at end of file
diff --git a/dist/datetime-picker/index.wxml b/dist/datetime-picker/index.wxml
deleted file mode 100644
index 2bba4abb..00000000
--- a/dist/datetime-picker/index.wxml
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-{{text || placeholder}}
-
-
-
-
-
-
-
-
- 取消
- 确认
-
-
-
-
-
\ No newline at end of file
diff --git a/dist/datetime-picker/index.wxss b/dist/datetime-picker/index.wxss
deleted file mode 100644
index fe180685..00000000
--- a/dist/datetime-picker/index.wxss
+++ /dev/null
@@ -1,53 +0,0 @@
-.picker-visible {
- height: 236px;
- bottom: 0;
-}
-
-picker-view-column.year-view-column {
- width: 50px;
- flex: 2;
-}
-picker-view-column {
- width: 30px;
- text-align: center;
-}
-.hidden {
- display: none;
-}
-.view-column-tip {
- height: 235px;
- line-height: 235px;
- margin: 0 5px;
-}
-
-.picker {
- width: 100vw;
- height: 100vh;
- top: 0;
- left: 0;
- z-index: 12;
-}
-
-.picker .picker-action {
- height: 36px;
- bottom: 235px;
- padding: 0 15px;
- width: 100%;
- display: flex;
- align-items: center;
- position: absolute;
- background: #fff;
- box-sizing: border-box;
- border-bottom: 1rpx solid #e5e5e5;
- justify-content: space-between;
-}
-.picker-action view:last-child {
- color: #1aad16;
-}
-
-.picker picker-view {
- position: absolute;
- bottom: 0;
- background: #fff;
- width: 100vw;
-}
\ No newline at end of file
diff --git a/dist/datetime-picker/picker-view-column.wxml b/dist/datetime-picker/picker-view-column.wxml
deleted file mode 100644
index 9f407a04..00000000
--- a/dist/datetime-picker/picker-view-column.wxml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
- {{item}}
-
- {{ tip }}
-
\ No newline at end of file
diff --git a/dist/datetime-picker/utils.js b/dist/datetime-picker/utils.js
deleted file mode 100644
index d92fbf92..00000000
--- a/dist/datetime-picker/utils.js
+++ /dev/null
@@ -1,124 +0,0 @@
-'use strict';
-
-function partStartWithZero(num, strlen) {
- var zeros = '';
- while (zeros.length < strlen) {
- zeros += '0';
- }
- return (zeros + num).slice(-strlen);
-}
-
-module.exports.genNumber = function genNumber(begin, end, strlen) {
- var nums = [];
- while (begin <= end) {
- nums.push(partStartWithZero(begin, strlen));
- begin++;
- }
- return nums;
-};
-
-module.exports.moment = function moment(date) {
- var formatStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'YYYY:MM:DD';
-
- if (!date && date !== 0) date = new Date();
-
- date = new Date(date);
- if (date.toString() === 'Invalid Date') throw new Error('Invalid Date');
-
- var getDateValue = function getDateValue(method, fn) {
- return fn ? fn(date['get' + method]()) : date['get' + method]();
- };
- var map = new Map();
-
- map.set(/(Y+)/i, function () {
- return getDateValue('FullYear', function (year) {
- return (year + '').substr(4 - RegExp.$1.length);
- });
- });
- map.set(/(M+)/, function () {
- return getDateValue('Month', function (month) {
- return partStartWithZero(month + 1, RegExp.$1.length);
- });
- });
- map.set(/(D+)/i, function () {
- return getDateValue('Date', function (date) {
- return partStartWithZero(date, RegExp.$1.length);
- });
- });
- map.set(/(H+)/i, function () {
- return getDateValue('Hours', function (hour) {
- return partStartWithZero(hour, RegExp.$1.length);
- });
- });
- map.set(/(m+)/, function () {
- return getDateValue('Minutes', function (minute) {
- return partStartWithZero(minute, RegExp.$1.length);
- });
- });
- map.set(/(s+)/, function () {
- return getDateValue('Seconds', function (second) {
- return partStartWithZero(second, RegExp.$1.length);
- });
- });
-
- for (var _iterator = map, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
- var _ref2;
-
- if (_isArray) {
- if (_i >= _iterator.length) break;
- _ref2 = _iterator[_i++];
- } else {
- _i = _iterator.next();
- if (_i.done) break;
- _ref2 = _i.value;
- }
-
- var _ref = _ref2;
- var reg = _ref[0];
- var fn = _ref[1];
-
- if (reg.test(formatStr)) {
- formatStr = formatStr.replace(RegExp.$1, fn.call(null));
- }
- }
-
- return formatStr;
-};
-
-module.exports.iso2utc = function (string) {
- var regexp = "([0-9]{4})(-([0-9]{2})(-([0-9]{2})(T([0-9]{2}):([0-9]{2})(:([0-9]{2})(\.([0-9]+))?)?(Z|(([-+])([0-9]{2}):([0-9]{2})))?)?)?)?";
- if (string) {
- var d = string.match(new RegExp(regexp));
- var offset = 0;
- var date = new Date(d[1], 0, 1);
-
- if (d[3]) {
- date.setMonth(d[3] - 1);
- }
- if (d[5]) {
- date.setDate(+d[5]);
- }
- if (d[7]) {
- date.setHours(d[7]);
- }
- if (d[8]) {
- date.setMinutes(d[8]);
- }
- if (d[10]) {
- date.setSeconds(d[10]);
- }
- if (d[12]) {
- date.setMilliseconds(Number("0." + d[12]) * 1000);
- }
- if (d[14]) {
- offset = Number(d[16]) * 60 + Number(d[17]);
- offset *= d[15] == '-' ? 1 : -1;
- }
-
- offset -= date.getTimezoneOffset();
-
- return Number(date) + offset * 60 * 1000;
- } else {
- return string;
- }
-};
\ No newline at end of file
diff --git a/dist/dialog/data.js b/dist/dialog/data.js
deleted file mode 100644
index db43a125..00000000
--- a/dist/dialog/data.js
+++ /dev/null
@@ -1,26 +0,0 @@
-'use strict';
-
-module.exports = {
- // 标题
- title: '',
- // 内容
- message: ' ',
- // 选择节点
- selector: '#van-dialog',
- // 按钮是否展示为纵向
- buttonsShowVertical: false,
- // 是否展示确定
- showConfirmButton: true,
- // 确认按钮文案
- confirmButtonText: '确定',
- // 确认按钮颜色
- confirmButtonColor: '#3CC51F',
- // 是否展示取消
- showCancelButton: false,
- // 取消按钮文案
- cancelButtonText: '取消',
- // 取消按钮颜色
- cancelButtonColor: '#333',
- // 点击按钮自动关闭 dialog
- autoClose: true
-};
\ No newline at end of file
diff --git a/dist/dialog/dialog.js b/dist/dialog/dialog.js
deleted file mode 100644
index aef6d658..00000000
--- a/dist/dialog/dialog.js
+++ /dev/null
@@ -1,104 +0,0 @@
-'use strict';
-
-var defaultData = require('./data');
-
-function getDialogCtx(_ref) {
- var selector = _ref.selector,
- pageCtx = _ref.pageCtx;
-
- var ctx = pageCtx;
- if (!ctx) {
- var pages = getCurrentPages();
- ctx = pages[pages.length - 1];
- }
- return ctx.selectComponent(selector);
-}
-
-function getParsedOptions() {
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
-
- return Object.assign({
- // 自定义 button 列表
- // { type: 按钮类型,回调时以此作为区分依据,text: 按钮文案, color: 按钮文字颜色 }
- buttons: []
- }, defaultData, options);
-}
-
-// options 使用参数
-// pageCtx 页面 page 上下文
-function Dialog(options, pageCtx) {
- var parsedOptions = getParsedOptions(options);
-
- var dialogCtx = getDialogCtx({
- selector: parsedOptions.selector,
- pageCtx: pageCtx
- });
-
- if (!dialogCtx) {
- console.error('无法找到对应的dialog组件,请于页面中注册并在 wxml 中声明 dialog 自定义组件');
- return Promise.reject({ type: 'component error' });
- }
-
- // 处理默认按钮的展示
- // 纵向排布确认按钮在上方
- var _parsedOptions$button = parsedOptions.buttons,
- buttons = _parsedOptions$button === undefined ? [] : _parsedOptions$button;
-
- var showCustomBtns = false;
- if (buttons.length === 0) {
- if (parsedOptions.showConfirmButton) {
- buttons.push({
- type: 'confirm',
- text: parsedOptions.confirmButtonText,
- color: parsedOptions.confirmButtonColor
- });
- }
-
- if (parsedOptions.showCancelButton) {
- var cancelButton = {
- type: 'cancel',
- text: parsedOptions.cancelButtonText,
- color: parsedOptions.cancelButtonColor
- };
- if (parsedOptions.buttonsShowVertical) {
- buttons.push(cancelButton);
- } else {
- buttons.unshift(cancelButton);
- }
- }
- } else {
- showCustomBtns = true;
- }
-
- return new Promise(function (resolve, reject) {
- dialogCtx.setData(Object.assign({}, parsedOptions, {
- buttons: buttons,
- showCustomBtns: showCustomBtns,
- key: '' + new Date().getTime(),
- show: true,
- promiseFunc: { resolve: resolve, reject: reject },
- openTypePromiseFunc: null
- }));
- });
-}
-
-Dialog.close = function (options, pageCtx) {
- var parsedOptions = getParsedOptions(options);
-
- var dialogCtx = getDialogCtx({
- selector: parsedOptions.selector,
- pageCtx: pageCtx
- });
-
- if (!dialogCtx) {
- return;
- }
-
- dialogCtx.setData({
- show: false,
- promiseFunc: null,
- openTypePromiseFunc: null
- });
-};
-
-module.exports = Dialog;
\ No newline at end of file
diff --git a/dist/dialog/index.js b/dist/dialog/index.js
deleted file mode 100644
index 71848e04..00000000
--- a/dist/dialog/index.js
+++ /dev/null
@@ -1,133 +0,0 @@
-'use strict';
-
-var _f = function _f() {};
-var needResponseOpenTypes = ['getUserInfo', 'getPhoneNumber', 'openSetting'];
-
-Component({
- properties: {},
-
- data: {
- // 标题
- title: '',
- // 自定义 button 列表
- // { type: 按钮类型,回调时以此作为区分依据,text: 按钮文案, color: 按钮文字颜色, openType: 微信开放能力 }
- buttons: [],
- // 内容
- message: ' ',
- // 选择节点
- selector: '#van-dialog',
- // 按钮是否展示为纵向
- buttonsShowVertical: false,
- // 是否展示确定
- showConfirmButton: true,
- // 确认按钮文案
- confirmButtonText: '确定',
- // 确认按钮颜色
- confirmButtonColor: '#3CC51F',
- // 是否展示取消
- showCancelButton: false,
- // 取消按钮文案
- cancelButtonText: '取消',
- // 取消按钮颜色
- cancelButtonColor: '#333',
- key: '',
- autoClose: true,
- show: false,
- showCustomBtns: false,
- promiseFunc: {},
- openTypePromiseFunc: {}
- },
-
- methods: {
- handleButtonClick: function handleButtonClick(e) {
- var _this = this;
-
- var _e$currentTarget = e.currentTarget,
- currentTarget = _e$currentTarget === undefined ? {} : _e$currentTarget;
- var _currentTarget$datase = currentTarget.dataset,
- dataset = _currentTarget$datase === undefined ? {} : _currentTarget$datase;
-
- // 获取当次弹出框的信息
-
- var _ref = this.data.promiseFunc || {},
- _ref$resolve = _ref.resolve,
- resolve = _ref$resolve === undefined ? _f : _ref$resolve,
- _ref$reject = _ref.reject,
- reject = _ref$reject === undefined ? _f : _ref$reject;
-
- // 重置展示
-
-
- if (this.data.autoClose) {
- this.setData({ show: false });
- }
-
- // 自定义按钮,全部 resolve 形式返回,根据 type 区分点击按钮
- if (this.data.showCustomBtns) {
- var isNeedOpenDataButton = needResponseOpenTypes.indexOf(dataset.openType) > -1;
- var resolveData = { type: dataset.type };
- // 如果需要 openData,就额外返回一个 promise,用于后续 open 数据返回
- if (isNeedOpenDataButton) {
- resolveData.openDataPromise = new Promise(function (resolve, reject) {
- _this.setData({ openTypePromiseFunc: { resolve: resolve, reject: reject } });
- });
- resolveData.hasOpenDataPromise = true;
- }
- resolve(resolveData);
- return;
- }
-
- // 默认按钮,确认为 resolve,取消为 reject
- if (dataset.type === 'confirm') {
- resolve({
- type: 'confirm'
- });
- } else {
- reject({
- type: 'cancel'
- });
- }
-
- this.setData({ promiseFunc: {} });
- },
-
-
- // 以下为处理微信按钮开放能力的逻辑
- handleUserInfoResponse: function handleUserInfoResponse(_ref2) {
- var detail = _ref2.detail;
-
- this.__handleOpenDataResponse({
- type: detail.errMsg === 'getUserInfo:ok' ? 'resolve' : 'reject',
- data: detail
- });
- },
- handlePhoneResponse: function handlePhoneResponse(_ref3) {
- var detail = _ref3.detail;
-
- this.__handleOpenDataResponse({
- type: detail.errMsg === 'getPhoneNumber:ok' ? 'resolve' : 'reject',
- data: detail
- });
- },
- handleOpenSettingResponse: function handleOpenSettingResponse(_ref4) {
- var detail = _ref4.detail;
-
- this.__handleOpenDataResponse({
- type: detail.errMsg === 'openSetting:ok' ? 'resolve' : 'reject',
- data: detail
- });
- },
- __handleOpenDataResponse: function __handleOpenDataResponse(_ref5) {
- var _ref5$type = _ref5.type,
- type = _ref5$type === undefined ? 'resolve' : _ref5$type,
- _ref5$data = _ref5.data,
- data = _ref5$data === undefined ? {} : _ref5$data;
-
- var promiseFuncs = this.data.openTypePromiseFunc || {};
- var responseFunc = promiseFuncs[type] || _f;
-
- responseFunc(data);
- this.setData({ openTypePromiseFunc: null });
- }
- }
-});
\ No newline at end of file
diff --git a/dist/dialog/index.json b/dist/dialog/index.json
deleted file mode 100644
index 4c9bf594..00000000
--- a/dist/dialog/index.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "component": true,
- "usingComponents": {
- "pop-manager": "../common/pop-manager/index",
- "van-button": "../button/index"
- }
-}
diff --git a/dist/dialog/index.wxml b/dist/dialog/index.wxml
deleted file mode 100644
index a61145c1..00000000
--- a/dist/dialog/index.wxml
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-
-
- {{ message }}
-
-
-
-
diff --git a/dist/dialog/index.wxss b/dist/dialog/index.wxss
deleted file mode 100644
index c407dee8..00000000
--- a/dist/dialog/index.wxss
+++ /dev/null
@@ -1 +0,0 @@
-.van-dialog--container{width:80vw;font-size:16px;overflow:hidden;border-radius:4px;background-color:#fff;color:#333}.van-dialog__header{padding:15px 0 0;text-align:center}.van-dialog__content{position:relative;padding:15px 20px;line-height:1.5;min-height:40px}.van-dialog__content::after{border-bottom-width:1px}.van-dialog__content--title{color:#999;font-size:14px}.van-dialog__footer{overflow:hidden}.van-dialog__button{-webkit-box-flex:1;flex:1}.van-dialog__button-inside,.van-dialog__button-inside--first{margin-bottom:0;line-height:50px;height:50px}.van-dialog__button-inside--first::after,.van-dialog__button-inside::after{border-width:0;border-radius:0}.van-dialog__footer--horizon{display:-webkit-box;display:flex}.van-dialog__footer--horizon .van-dialog__button-inside::after{border-left-width:1px}.van-dialog__footer--vertical .van-dialog__button-inside::after{border-top-width:1px}
\ No newline at end of file
diff --git a/dist/field/index.wxss b/dist/field/index.wxss
index 7e96a322..4d998022 100644
--- a/dist/field/index.wxss
+++ b/dist/field/index.wxss
@@ -1 +1 @@
-.van-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.van-clearfix::after{content:'';display:table;clear:both}.van-hairline,.van-hairline--bottom,.van-hairline--left,.van-hairline--right,.van-hairline--surround,.van-hairline--top,.van-hairline--top-bottom{position:relative}.van-hairline--bottom::after,.van-hairline--left::after,.van-hairline--right::after,.van-hairline--surround::after,.van-hairline--top-bottom::after,.van-hairline--top::after,.van-hairline::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;-webkit-transform:scale(.5);transform:scale(.5);-webkit-transform-origin:0 0;transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e5e5e5}.van-hairline--top::after{border-top-width:1px}.van-hairline--left::after{border-left-width:1px}.van-hairline--right::after{border-right-width:1px}.van-hairline--bottom::after{border-bottom-width:1px}.van-hairline--top-bottom::after{border-width:1px 0}.van-hairline--surround::after{border-width:1px}@-webkit-keyframes van-slide-bottom-enter{from{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@keyframes van-slide-bottom-enter{from{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@-webkit-keyframes van-slide-bottom-leave{to{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@keyframes van-slide-bottom-leave{to{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@-webkit-keyframes van-fade-in{from{opacity:0}to{opacity:1}}@keyframes van-fade-in{from{opacity:0}to{opacity:1}}@-webkit-keyframes van-fade-out{from{opacity:1}to{opacity:0}}@keyframes van-fade-out{from{opacity:1}to{opacity:0}}@-webkit-keyframes van-rotate{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes van-rotate{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.van-fade-enter-active{-webkit-animation:.3s van-fade-in;animation:.3s van-fade-in}.van-fade-leave-active{-webkit-animation:.3s van-fade-out;animation:.3s van-fade-out}.van-slide-bottom-enter-active{-webkit-animation:van-slide-bottom-enter .3s both ease;animation:van-slide-bottom-enter .3s both ease}.van-slide-bottom-leave-active{-webkit-animation:van-slide-bottom-leave .3s both ease;animation:van-slide-bottom-leave .3s both ease}.van-field__body{display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center}.van-field__body--textarea{min-height:24px}.van-field__control{border:0;margin:0;padding:0;width:100%;resize:none;display:block;text-align:left;box-sizing:border-box;line-height:inherit;background-color:transparent}.van-field__control--disabled{opacity:1;color:#666;background-color:transparent}.van-field__control--center{text-align:center}.van-field__control--right{text-align:right}.van-field__button,.van-field__clear,.van-field__icon-container{flex-shrink:0}.van-field__clear,.van-field__icon-container{padding:0 10px;color:#999;line-height:inherit;margin-right:-10px;vertical-align:middle}.van-field__icon{display:block;font-size:16px;line-height:inherit}.van-field__button{padding-left:10px}.van-field__error-message{color:#f44;font-size:12px;text-align:left}.van-field--error{color:#f44}.van-field--label-center .van-cell__title{text-align:center}.van-field--label-right .van-cell__title{text-align:right}
\ No newline at end of file
+.van-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.van-clearfix::after{content:'';display:table;clear:both}.van-hairline,.van-hairline--bottom,.van-hairline--left,.van-hairline--right,.van-hairline--surround,.van-hairline--top,.van-hairline--top-bottom{position:relative}.van-hairline--bottom::after,.van-hairline--left::after,.van-hairline--right::after,.van-hairline--surround::after,.van-hairline--top-bottom::after,.van-hairline--top::after,.van-hairline::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;-webkit-transform:scale(.5);transform:scale(.5);-webkit-transform-origin:0 0;transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e5e5e5}.van-hairline--top::after{border-top-width:1px}.van-hairline--left::after{border-left-width:1px}.van-hairline--right::after{border-right-width:1px}.van-hairline--bottom::after{border-bottom-width:1px}.van-hairline--top-bottom::after{border-width:1px 0}.van-hairline--surround::after{border-width:1px}@-webkit-keyframes van-slide-bottom-enter{from{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@keyframes van-slide-bottom-enter{from{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@-webkit-keyframes van-slide-bottom-leave{to{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@keyframes van-slide-bottom-leave{to{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@-webkit-keyframes van-fade-in{from{opacity:0}to{opacity:1}}@keyframes van-fade-in{from{opacity:0}to{opacity:1}}@-webkit-keyframes van-fade-out{from{opacity:1}to{opacity:0}}@keyframes van-fade-out{from{opacity:1}to{opacity:0}}@-webkit-keyframes van-rotate{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes van-rotate{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.van-fade-enter-active{-webkit-animation:.3s van-fade-in;animation:.3s van-fade-in}.van-fade-leave-active{-webkit-animation:.3s van-fade-out;animation:.3s van-fade-out}.van-slide-bottom-enter-active{-webkit-animation:van-slide-bottom-enter .3s both ease;animation:van-slide-bottom-enter .3s both ease}.van-slide-bottom-leave-active{-webkit-animation:van-slide-bottom-leave .3s both ease;animation:van-slide-bottom-leave .3s both ease}.van-field__body{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.van-field__body--textarea{min-height:24px}.van-field__control{border:0;margin:0;padding:0;width:100%;resize:none;display:block;text-align:left;box-sizing:border-box;line-height:inherit;background-color:transparent}.van-field__control--disabled{opacity:1;color:#666;background-color:transparent}.van-field__control--center{text-align:center}.van-field__control--right{text-align:right}.van-field__button,.van-field__clear,.van-field__icon-container{-webkit-flex-shrink:0;flex-shrink:0}.van-field__clear,.van-field__icon-container{padding:0 10px;color:#999;line-height:inherit;margin-right:-10px;vertical-align:middle}.van-field__icon{display:block;font-size:16px;line-height:inherit}.van-field__button{padding-left:10px}.van-field__error-message{color:#f44;font-size:12px;text-align:left}.van-field--error{color:#f44}.van-field--label-center .van-cell__title{text-align:center}.van-field--label-right .van-cell__title{text-align:right}
\ No newline at end of file
diff --git a/dist/notice-bar/index.wxss b/dist/notice-bar/index.wxss
index 29fb6cbf..549d026d 100644
--- a/dist/notice-bar/index.wxss
+++ b/dist/notice-bar/index.wxss
@@ -1 +1 @@
-.van-notice-bar{display:-webkit-box;display:flex;padding:9px 10px;font-size:12px;line-height:1.5}.van-notice-bar--within-icon{position:relative;padding-right:30px}.van-notice-bar__left-icon{height:18px;min-width:20px;padding-top:1px;box-sizing:border-box}.van-notice-bar__left-icon>image{width:16px;height:16px}.van-notice-bar__right-icon{position:absolute;top:10px;right:10px;font-size:15px;line-height:1}.van-notice-bar__content-wrap{position:relative;-webkit-box-flex:1;flex:1;height:18px;overflow:hidden}.van-notice-bar__content{position:absolute;white-space:nowrap}
\ No newline at end of file
+.van-notice-bar{display:-webkit-box;display:-webkit-flex;display:flex;padding:9px 10px;font-size:12px;line-height:1.5}.van-notice-bar--within-icon{position:relative;padding-right:30px}.van-notice-bar__left-icon{height:18px;min-width:20px;padding-top:1px;box-sizing:border-box}.van-notice-bar__left-icon>image{width:16px;height:16px}.van-notice-bar__right-icon{position:absolute;top:10px;right:10px;font-size:15px;line-height:1}.van-notice-bar__content-wrap{position:relative;-webkit-box-flex:1;-webkit-flex:1;flex:1;height:18px;overflow:hidden}.van-notice-bar__content{position:absolute;white-space:nowrap}
\ No newline at end of file
diff --git a/dist/radio/index.js b/dist/radio/index.js
deleted file mode 100644
index c6934df7..00000000
--- a/dist/radio/index.js
+++ /dev/null
@@ -1,33 +0,0 @@
-'use strict';
-
-Component({
- behaviors: ['wx://form-field'],
-
- externalClasses: ['radio-class', 'radio-color'],
-
- properties: {
- items: Array,
- type: String
- },
-
- methods: {
- radioChange: function radioChange(e) {
- this.selectItem(e.detail.value);
- this.triggerEvent('change', e);
- },
- selectItem: function selectItem(value) {
- var items = this.data.items;
-
-
- items.forEach(function (item) {
- if (item.name === value) {
- item.checked = true;
- } else {
- item.checked = false;
- }
- });
-
- this.setData({ items: items });
- }
- }
-});
\ No newline at end of file
diff --git a/dist/radio/index.json b/dist/radio/index.json
deleted file mode 100644
index 0a336c08..00000000
--- a/dist/radio/index.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "component": true,
- "usingComponents": {
- "van-icon": "../icon/index"
- }
-}
diff --git a/dist/radio/index.wxml b/dist/radio/index.wxml
deleted file mode 100644
index 961b8c1a..00000000
--- a/dist/radio/index.wxml
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
-
diff --git a/dist/radio/index.wxss b/dist/radio/index.wxss
deleted file mode 100644
index a12713fe..00000000
--- a/dist/radio/index.wxss
+++ /dev/null
@@ -1 +0,0 @@
-.van-radio{display:block;padding:0 10px;font-size:14px}.van-radio__item{display:block;margin-top:10px;height:20px}.van-radio__item:last-child{margin-bottom:10px}.van-radio__list-item{display:block;padding:10px 10px 10px 0;border-bottom:1px solid #e5e5e5}.van-radio__list-item .van-radio__icon-wrap{float:right;margin-top:3px}.van-radio__icon-wrap{position:relative;width:14px;height:15px;display:-webkit-inline-box;display:inline-flex;-webkit-box-align:center;align-items:center;color:#aaa}.van-radio__icon-wrap .van-radio__origin{opacity:0;width:14px;height:20px}.van-radio__icon-wrap .van-radio__icon{position:absolute;left:50%;top:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);border:1px solid #dcdfe6;border-radius:100%;width:14px;height:14px;background-color:#fff;cursor:pointer;box-sizing:border-box}.van-radio__icon-wrap .van-radio__icon .van-radio__icon-inside{position:absolute;left:50%;top:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);width:4px;height:4px;border-radius:50%}.van-radio__icon-wrap .van-radio__icon.van-radio--checked{border-color:#06bf04;background:#06bf04}.van-radio__icon-wrap .van-radio__icon.van-radio--checked .van-radio__icon-inside{background-color:#fff}.van-radio__icon-wrap .van-radio__icon.van-radio--disabled{opacity:.6}.van-radio__name{display:inline-block;margin-left:10px}
\ No newline at end of file
diff --git a/dist/search/index.wxss b/dist/search/index.wxss
index a2ad2922..ee5c4e3a 100644
--- a/dist/search/index.wxss
+++ b/dist/search/index.wxss
@@ -1 +1 @@
-.van-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.van-clearfix::after{content:'';display:table;clear:both}.van-hairline,.van-hairline--bottom,.van-hairline--left,.van-hairline--right,.van-hairline--surround,.van-hairline--top,.van-hairline--top-bottom{position:relative}.van-hairline--bottom::after,.van-hairline--left::after,.van-hairline--right::after,.van-hairline--surround::after,.van-hairline--top-bottom::after,.van-hairline--top::after,.van-hairline::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;-webkit-transform:scale(.5);transform:scale(.5);-webkit-transform-origin:0 0;transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e5e5e5}.van-hairline--top::after{border-top-width:1px}.van-hairline--left::after{border-left-width:1px}.van-hairline--right::after{border-right-width:1px}.van-hairline--bottom::after{border-bottom-width:1px}.van-hairline--top-bottom::after{border-width:1px 0}.van-hairline--surround::after{border-width:1px}@-webkit-keyframes van-slide-bottom-enter{from{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@keyframes van-slide-bottom-enter{from{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@-webkit-keyframes van-slide-bottom-leave{to{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@keyframes van-slide-bottom-leave{to{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@-webkit-keyframes van-fade-in{from{opacity:0}to{opacity:1}}@keyframes van-fade-in{from{opacity:0}to{opacity:1}}@-webkit-keyframes van-fade-out{from{opacity:1}to{opacity:0}}@keyframes van-fade-out{from{opacity:1}to{opacity:0}}@-webkit-keyframes van-rotate{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes van-rotate{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.van-fade-enter-active{-webkit-animation:.3s van-fade-in;animation:.3s van-fade-in}.van-fade-leave-active{-webkit-animation:.3s van-fade-out;animation:.3s van-fade-out}.van-slide-bottom-enter-active{-webkit-animation:van-slide-bottom-enter .3s both ease;animation:van-slide-bottom-enter .3s both ease}.van-slide-bottom-leave-active{-webkit-animation:van-slide-bottom-leave .3s both ease;animation:van-slide-bottom-leave .3s both ease}.van-search{display:-webkit-box;display:flex;padding:7px 15px;-webkit-box-align:center;align-items:center;box-sizing:border-box}.van-search__field{-webkit-box-flex:1;flex:1;border-radius:4px}.van-search__field__left-icon{color:#999}.van-search--show-action{padding-right:0}.van-search input::-webkit-search-cancel-button,.van-search input::-webkit-search-decoration,.van-search input::-webkit-search-results-button,.van-search input::-webkit-search-results-decoration{display:none}.van-search__action{padding:0 10px;font-size:14px;line-height:30px;color:#666}.van-search__action:active{background-color:#e8e8e8}
\ No newline at end of file
+.van-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.van-clearfix::after{content:'';display:table;clear:both}.van-hairline,.van-hairline--bottom,.van-hairline--left,.van-hairline--right,.van-hairline--surround,.van-hairline--top,.van-hairline--top-bottom{position:relative}.van-hairline--bottom::after,.van-hairline--left::after,.van-hairline--right::after,.van-hairline--surround::after,.van-hairline--top-bottom::after,.van-hairline--top::after,.van-hairline::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;-webkit-transform:scale(.5);transform:scale(.5);-webkit-transform-origin:0 0;transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e5e5e5}.van-hairline--top::after{border-top-width:1px}.van-hairline--left::after{border-left-width:1px}.van-hairline--right::after{border-right-width:1px}.van-hairline--bottom::after{border-bottom-width:1px}.van-hairline--top-bottom::after{border-width:1px 0}.van-hairline--surround::after{border-width:1px}@-webkit-keyframes van-slide-bottom-enter{from{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@keyframes van-slide-bottom-enter{from{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@-webkit-keyframes van-slide-bottom-leave{to{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@keyframes van-slide-bottom-leave{to{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@-webkit-keyframes van-fade-in{from{opacity:0}to{opacity:1}}@keyframes van-fade-in{from{opacity:0}to{opacity:1}}@-webkit-keyframes van-fade-out{from{opacity:1}to{opacity:0}}@keyframes van-fade-out{from{opacity:1}to{opacity:0}}@-webkit-keyframes van-rotate{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes van-rotate{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.van-fade-enter-active{-webkit-animation:.3s van-fade-in;animation:.3s van-fade-in}.van-fade-leave-active{-webkit-animation:.3s van-fade-out;animation:.3s van-fade-out}.van-slide-bottom-enter-active{-webkit-animation:van-slide-bottom-enter .3s both ease;animation:van-slide-bottom-enter .3s both ease}.van-slide-bottom-leave-active{-webkit-animation:van-slide-bottom-leave .3s both ease;animation:van-slide-bottom-leave .3s both ease}.van-search{display:-webkit-box;display:-webkit-flex;display:flex;padding:7px 15px;-webkit-box-align:center;-webkit-align-items:center;align-items:center;box-sizing:border-box}.van-search__field{-webkit-box-flex:1;-webkit-flex:1;flex:1;border-radius:4px}.van-search__field__left-icon{color:#999}.van-search--show-action{padding-right:0}.van-search input::-webkit-search-cancel-button,.van-search input::-webkit-search-decoration,.van-search input::-webkit-search-results-button,.van-search input::-webkit-search-results-decoration{display:none}.van-search__action{padding:0 10px;font-size:14px;line-height:30px;color:#666}.van-search__action:active{background-color:#e8e8e8}
\ No newline at end of file
diff --git a/dist/steps/index.js b/dist/steps/index.js
index 3ea5287b..3fdea3f0 100644
--- a/dist/steps/index.js
+++ b/dist/steps/index.js
@@ -1,5 +1,7 @@
'use strict';
+var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
+
Component({
externalClasses: ['custom-class'],
@@ -39,7 +41,7 @@ Component({
var steps = this.data.steps;
var formattedSteps = steps.map(function (step, index) {
- return Object.assign({}, step, {
+ return _extends({}, step, {
status: _this.getStatus(index)
});
});
diff --git a/dist/steps/index.wxss b/dist/steps/index.wxss
index bfc2dab2..06807854 100644
--- a/dist/steps/index.wxss
+++ b/dist/steps/index.wxss
@@ -1 +1 @@
-.van-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.van-clearfix::after{content:'';display:table;clear:both}.van-hairline,.van-hairline--bottom,.van-hairline--left,.van-hairline--right,.van-hairline--surround,.van-hairline--top,.van-hairline--top-bottom{position:relative}.van-hairline--bottom::after,.van-hairline--left::after,.van-hairline--right::after,.van-hairline--surround::after,.van-hairline--top-bottom::after,.van-hairline--top::after,.van-hairline::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;-webkit-transform:scale(.5);transform:scale(.5);-webkit-transform-origin:0 0;transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e5e5e5}.van-hairline--top::after{border-top-width:1px}.van-hairline--left::after{border-left-width:1px}.van-hairline--right::after{border-right-width:1px}.van-hairline--bottom::after{border-bottom-width:1px}.van-hairline--top-bottom::after{border-width:1px 0}.van-hairline--surround::after{border-width:1px}@-webkit-keyframes van-slide-bottom-enter{from{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@keyframes van-slide-bottom-enter{from{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@-webkit-keyframes van-slide-bottom-leave{to{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@keyframes van-slide-bottom-leave{to{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@-webkit-keyframes van-fade-in{from{opacity:0}to{opacity:1}}@keyframes van-fade-in{from{opacity:0}to{opacity:1}}@-webkit-keyframes van-fade-out{from{opacity:1}to{opacity:0}}@keyframes van-fade-out{from{opacity:1}to{opacity:0}}@-webkit-keyframes van-rotate{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes van-rotate{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.van-fade-enter-active{-webkit-animation:.3s van-fade-in;animation:.3s van-fade-in}.van-fade-leave-active{-webkit-animation:.3s van-fade-out;animation:.3s van-fade-out}.van-slide-bottom-enter-active{-webkit-animation:van-slide-bottom-enter .3s both ease;animation:van-slide-bottom-enter .3s both ease}.van-slide-bottom-leave-active{-webkit-animation:van-slide-bottom-leave .3s both ease;animation:van-slide-bottom-leave .3s both ease}.van-steps{overflow:hidden;background-color:#fff}.van-steps--horizontal{display:-webkit-box;display:flex;overflow:hidden;position:relative;padding:10px 10px 15px}.van-steps--vertical{padding:0 0 0 35px}.van-step{-webkit-box-flex:1;flex:1;font-size:14px;position:relative;color:#999}.van-step--finish{color:#333}.van-step__circle{width:5px;height:5px;background-color:#999;border-radius:50%}.van-step--horizontal{float:left;padding-bottom:10px}.van-step--horizontal:first-child .van-step__title{-webkit-transform:none;transform:none;margin-left:0}.van-step--horizontal:last-child{position:absolute;right:10px;width:auto}.van-step--horizontal:last-child .van-step__title{-webkit-transform:none;transform:none;margin-left:0;text-align:right}.van-step--horizontal:last-child .van-step__circle-container{left:auto;right:-9px}.van-step--horizontal:last-child .van-step__line{width:0}.van-step--horizontal .van-step__circle-container{position:absolute;bottom:0;left:-8px;padding:0 8px;background-color:#fff;z-index:1}.van-step--horizontal .van-step__title{font-size:12px;-webkit-transform:translate3d(-50%,0,0);transform:translate3d(-50%,0,0);display:inline-block;margin-left:3px}.van-step--horizontal .van-step__line{position:absolute;left:0;bottom:2px;width:100%;height:1px;background-color:#e5e5e5}.van-step--horizontal.van-step--process{color:#333}.van-step--horizontal.van-step--process .van-step__circle-container{bottom:-4px}.van-step--horizontal.van-step--process .van-step__active{font-size:12px;color:#06bf04;display:block;line-height:1}.van-step--vertical{font-size:14px;line-height:18px;padding:10px 10px 10px 0}.van-step--vertical:not(:last-child)::after{border-bottom-width:1px}.van-step--vertical:first-child::before{content:'';position:absolute;width:1px;height:20px;background-color:#fff;top:0;left:-15px;z-index:1}.van-step--vertical .van-step__active,.van-step--vertical .van-step__circle{z-index:2;position:absolute}.van-step--vertical .van-step__active{top:12px;left:-20px;line-height:1;font-size:12px}.van-step--vertical .van-step__circle{top:16px;left:-17px}.van-step--vertical .van-step__line{position:absolute;top:0;left:-15px;width:1px;height:100%;background-color:#e5e5e5}
\ No newline at end of file
+.van-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.van-clearfix::after{content:'';display:table;clear:both}.van-hairline,.van-hairline--bottom,.van-hairline--left,.van-hairline--right,.van-hairline--surround,.van-hairline--top,.van-hairline--top-bottom{position:relative}.van-hairline--bottom::after,.van-hairline--left::after,.van-hairline--right::after,.van-hairline--surround::after,.van-hairline--top-bottom::after,.van-hairline--top::after,.van-hairline::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;-webkit-transform:scale(.5);transform:scale(.5);-webkit-transform-origin:0 0;transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e5e5e5}.van-hairline--top::after{border-top-width:1px}.van-hairline--left::after{border-left-width:1px}.van-hairline--right::after{border-right-width:1px}.van-hairline--bottom::after{border-bottom-width:1px}.van-hairline--top-bottom::after{border-width:1px 0}.van-hairline--surround::after{border-width:1px}@-webkit-keyframes van-slide-bottom-enter{from{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@keyframes van-slide-bottom-enter{from{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@-webkit-keyframes van-slide-bottom-leave{to{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@keyframes van-slide-bottom-leave{to{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@-webkit-keyframes van-fade-in{from{opacity:0}to{opacity:1}}@keyframes van-fade-in{from{opacity:0}to{opacity:1}}@-webkit-keyframes van-fade-out{from{opacity:1}to{opacity:0}}@keyframes van-fade-out{from{opacity:1}to{opacity:0}}@-webkit-keyframes van-rotate{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes van-rotate{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.van-fade-enter-active{-webkit-animation:.3s van-fade-in;animation:.3s van-fade-in}.van-fade-leave-active{-webkit-animation:.3s van-fade-out;animation:.3s van-fade-out}.van-slide-bottom-enter-active{-webkit-animation:van-slide-bottom-enter .3s both ease;animation:van-slide-bottom-enter .3s both ease}.van-slide-bottom-leave-active{-webkit-animation:van-slide-bottom-leave .3s both ease;animation:van-slide-bottom-leave .3s both ease}.van-steps{overflow:hidden;background-color:#fff}.van-steps--horizontal{display:-webkit-box;display:-webkit-flex;display:flex;overflow:hidden;position:relative;padding:10px 10px 15px}.van-steps--vertical{padding:0 0 0 35px}.van-step{-webkit-box-flex:1;-webkit-flex:1;flex:1;font-size:14px;position:relative;color:#999}.van-step--finish{color:#333}.van-step__circle{width:5px;height:5px;background-color:#999;border-radius:50%}.van-step--horizontal{float:left;padding-bottom:10px}.van-step--horizontal:first-child .van-step__title{-webkit-transform:none;transform:none;margin-left:0}.van-step--horizontal:last-child{position:absolute;right:10px;width:auto}.van-step--horizontal:last-child .van-step__title{-webkit-transform:none;transform:none;margin-left:0;text-align:right}.van-step--horizontal:last-child .van-step__circle-container{left:auto;right:-9px}.van-step--horizontal:last-child .van-step__line{width:0}.van-step--horizontal .van-step__circle-container{position:absolute;bottom:0;left:-8px;padding:0 8px;background-color:#fff;z-index:1}.van-step--horizontal .van-step__title{font-size:12px;-webkit-transform:translate3d(-50%,0,0);transform:translate3d(-50%,0,0);display:inline-block;margin-left:3px}.van-step--horizontal .van-step__line{position:absolute;left:0;bottom:2px;width:100%;height:1px;background-color:#e5e5e5}.van-step--horizontal.van-step--process{color:#333}.van-step--horizontal.van-step--process .van-step__circle-container{bottom:-4px}.van-step--horizontal.van-step--process .van-step__active{font-size:12px;color:#06bf04;display:block;line-height:1}.van-step--vertical{font-size:14px;line-height:18px;padding:10px 10px 10px 0}.van-step--vertical:not(:last-child)::after{border-bottom-width:1px}.van-step--vertical:first-child::before{content:'';position:absolute;width:1px;height:20px;background-color:#fff;top:0;left:-15px;z-index:1}.van-step--vertical .van-step__active,.van-step--vertical .van-step__circle{z-index:2;position:absolute}.van-step--vertical .van-step__active{top:12px;left:-20px;line-height:1;font-size:12px}.van-step--vertical .van-step__circle{top:16px;left:-17px}.van-step--vertical .van-step__line{position:absolute;top:0;left:-15px;width:1px;height:100%;background-color:#e5e5e5}
\ No newline at end of file
diff --git a/dist/tab/index.js b/dist/tab/index.js
deleted file mode 100644
index 431f0a10..00000000
--- a/dist/tab/index.js
+++ /dev/null
@@ -1,61 +0,0 @@
-'use strict';
-
-Component({
- externalClasses: 'class',
-
- properties: {
- scroll: {
- type: Boolean,
- value: false
- },
- fixed: {
- type: Boolean,
- value: false
- },
- height: {
- type: Number,
- value: 0
- },
- list: {
- type: Array,
- value: []
- },
- selectedId: {
- type: [String, Number],
- value: ''
- }
- },
-
- data: {
- scrollLeft: 0
- },
-
- methods: {
- _handleScroll: function _handleScroll(selectedId) {
- var _this = this;
-
- var query = wx.createSelectorQuery().in(this);
- query.select('#item-' + selectedId).boundingClientRect();
- query.select('#scroll-view').boundingClientRect();
- query.select('#scroll-view').scrollOffset();
- query.exec(function (res) {
- _this.setData({
- scrollLeft: res[2].scrollLeft + res[0].left + res[0].width / 2 - res[1].width / 2
- });
- });
- },
- _handleZanTabChange: function _handleZanTabChange(e) {
- var selectedId = e.currentTarget.dataset.itemId;
-
- if (this.data.scroll) {
- this._handleScroll(selectedId);
- }
-
- this.setData({
- selectedId: selectedId
- });
-
- this.triggerEvent('tabchange', selectedId);
- }
- }
-});
\ No newline at end of file
diff --git a/dist/tab/index.json b/dist/tab/index.json
deleted file mode 100644
index 32640e0d..00000000
--- a/dist/tab/index.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "component": true
-}
\ No newline at end of file
diff --git a/dist/tab/index.wxml b/dist/tab/index.wxml
deleted file mode 100644
index 409e2670..00000000
--- a/dist/tab/index.wxml
+++ /dev/null
@@ -1,51 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ item.title }}
-
-
-
diff --git a/dist/tab/index.wxss b/dist/tab/index.wxss
deleted file mode 100644
index eb5b8ef8..00000000
--- a/dist/tab/index.wxss
+++ /dev/null
@@ -1 +0,0 @@
-.van-tab{height:45px}.van-tab__bd{width:100%;display:-webkit-box;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;border-bottom:1rpx solid #e5e5e5;background:#fff}.van-tab__bd--fixed{position:fixed;top:0;z-index:2}.van-tab__item{-webkit-box-flex:1;flex:1;display:inline-block;padding:0 5px;line-height:0;box-sizing:border-box;overflow:hidden;text-align:center}.van-tab__title{display:inline-block;max-width:100%;height:44px;line-height:44px;overflow:hidden;text-overflow:ellipsis;box-sizing:border-box;word-break:keep-all;font-size:14px;color:#666}.van-tab__item--selected .van-tab__title{color:#f44;border-bottom:2px solid #f44}.van-tab__bd--scroll{display:block;white-space:nowrap}.van-tab__bd--scroll .van-tab__item{min-width:80px}
\ No newline at end of file
diff --git a/dist/toast/index.js b/dist/toast/index.js
index a5044c54..924a2fdc 100644
--- a/dist/toast/index.js
+++ b/dist/toast/index.js
@@ -1,5 +1,7 @@
'use strict';
+var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
+
var DEFAULT_DATA = {
show: false,
message: '',
@@ -11,11 +13,11 @@ var DEFAULT_DATA = {
var SUPPORT_TYPE = ['loading', 'success', 'fail'];
Component({
- data: Object.assign({}, DEFAULT_DATA),
+ data: _extends({}, DEFAULT_DATA),
methods: {
show: function show(options) {
- var toastOptions = Object.assign({}, options);
+ var toastOptions = _extends({}, options);
var icon = options.icon || '';
var image = options.image || '';
@@ -24,13 +26,13 @@ Component({
image = '';
}
- this.setData(Object.assign({}, toastOptions, {
+ this.setData(_extends({}, toastOptions, {
icon: icon,
image: image
}));
},
clear: function clear() {
- this.setData(Object.assign({}, DEFAULT_DATA));
+ this.setData(_extends({}, DEFAULT_DATA));
}
}
});
\ No newline at end of file
diff --git a/dist/toast/toast.js b/dist/toast/toast.js
index 9757515b..5f206e7b 100644
--- a/dist/toast/toast.js
+++ b/dist/toast/toast.js
@@ -1,5 +1,7 @@
'use strict';
+var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
+
var TOAST_CONFIG_KEY = 'vant.__zanToastPageConfig';
var DEFAULT_SHOW_TOAST_TIME = 3000;
@@ -39,7 +41,7 @@ function Toast(optionsOrMsg, pageCtx) {
var ctx = getPageCtx(pageCtx);
var pageToastUserSetting = getPageToastConfig(ctx);
- var parsedOptions = Object.assign({}, globalToastUserConfig, pageToastUserSetting, options);
+ var parsedOptions = _extends({}, globalToastUserConfig, pageToastUserSetting, options);
var toastCtx = ctx.selectComponent(parsedOptions.selector);
if (!toastCtx) {
@@ -51,7 +53,7 @@ function Toast(optionsOrMsg, pageCtx) {
Toast.clear();
}
- toastCtx.show(Object.assign({}, parsedOptions, {
+ toastCtx.show(_extends({}, parsedOptions, {
show: true
}));
@@ -85,7 +87,7 @@ Toast.setDefaultOptions = function () {
};
if (type === 'global') {
- globalToastUserConfig = Object.assign({}, parsedDefaultOptions);
+ globalToastUserConfig = _extends({}, parsedDefaultOptions);
} else if (type === 'page') {
var _ctx$setData;
@@ -126,7 +128,7 @@ Toast.clear = function () {
Toast.loading = function () {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- Toast(Object.assign({}, options, {
+ Toast(_extends({}, options, {
type: 'loading'
}));
};
diff --git a/dist/toptips/index.js b/dist/toptips/index.js
deleted file mode 100644
index 23a453e0..00000000
--- a/dist/toptips/index.js
+++ /dev/null
@@ -1,54 +0,0 @@
-'use strict';
-
-var FONT_COLOR = '#fff';
-var BG_COLOR = '#e64340';
-
-Component({
- properties: {
- content: String,
- color: {
- type: String,
- value: FONT_COLOR
- },
- backgroundColor: {
- type: String,
- value: BG_COLOR
- },
- isShow: {
- type: Boolean,
- value: false
- },
- duration: {
- type: Number,
- value: 3000
- }
- },
-
- methods: {
- show: function show() {
- var _this = this;
-
- var duration = this.data.duration;
-
-
- this._timer && clearTimeout(this._timer);
- this.setData({
- isShow: true
- });
-
- if (duration > 0 && duration !== Infinity) {
- this._timer = setTimeout(function () {
- _this.hide();
- }, duration);
- }
- },
- hide: function hide() {
- this._timer = clearTimeout(this._timer);
-
- this.setData({
- isShow: false,
- backgroundColor: BG_COLOR
- });
- }
- }
-});
\ No newline at end of file
diff --git a/dist/toptips/index.json b/dist/toptips/index.json
deleted file mode 100644
index 32640e0d..00000000
--- a/dist/toptips/index.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "component": true
-}
\ No newline at end of file
diff --git a/dist/toptips/index.wxml b/dist/toptips/index.wxml
deleted file mode 100644
index 9f42050c..00000000
--- a/dist/toptips/index.wxml
+++ /dev/null
@@ -1 +0,0 @@
-{{ content }}
diff --git a/dist/toptips/index.wxss b/dist/toptips/index.wxss
deleted file mode 100644
index b91d540b..00000000
--- a/dist/toptips/index.wxss
+++ /dev/null
@@ -1 +0,0 @@
-.van-toptips{display:block;position:fixed;-webkit-transform:translateZ(0) translateY(-100%);width:100%;min-height:32px;top:0;line-height:2.3;font-size:14px;text-align:center;color:#fff;background-color:#e64340;z-index:110;opacity:0;-webkit-transition:all .4s ease;transition:all .4s ease}.van-toptips--show{-webkit-transform:translateZ(0) translateY(0);opacity:1}
\ No newline at end of file
diff --git a/dist/toptips/toptips.js b/dist/toptips/toptips.js
deleted file mode 100644
index 5bf6fb40..00000000
--- a/dist/toptips/toptips.js
+++ /dev/null
@@ -1,28 +0,0 @@
-'use strict';
-
-function Toptips() {
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
-
- var pages = getCurrentPages();
- var ctx = pages[pages.length - 1];
- var defaultOptions = {
- selector: '#van-toptips',
- duration: 3000
- };
-
- options = Object.assign(defaultOptions, parseParam(options));
-
- var $toptips = ctx.selectComponent(options.selector);
- delete options.selector;
-
- $toptips.setData(Object.assign({}, options));
- $toptips && $toptips.show();
-}
-
-function parseParam() {
- var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
-
- return typeof params === 'object' ? params : { content: params };
-}
-
-module.exports = Toptips;
\ No newline at end of file
diff --git a/dist/tree-select/index.js b/dist/tree-select/index.js
index ed63b166..145fb663 100644
--- a/dist/tree-select/index.js
+++ b/dist/tree-select/index.js
@@ -1,5 +1,7 @@
'use strict';
+var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
+
var ITEM_HEIGHT = 44;
Component({
@@ -40,24 +42,22 @@ Component({
methods: {
// 当一个子项被选择时
- onItemSelect: function onItemSelect(_ref) {
- var _ref$currentTarget = _ref.currentTarget,
- currentTarget = _ref$currentTarget === undefined ? {} : _ref$currentTarget;
- var _currentTarget$datase = currentTarget.dataset,
- data = _currentTarget$datase === undefined ? {} : _currentTarget$datase;
+ onItemSelect: function onItemSelect(event) {
+ var _ref = event.currentTarget || {},
+ _ref$dataset = _ref.dataset,
+ dataset = _ref$dataset === undefined ? {} : _ref$dataset;
- this.triggerEvent('itemclick', Object.assign({}, data.item || {}));
+ this.triggerEvent('itemclick', _extends({}, dataset.item || {}));
},
// 当一个导航被点击时
- handleNavClick: function handleNavClick(_ref2) {
- var _ref2$currentTarget = _ref2.currentTarget,
- currentTarget = _ref2$currentTarget === undefined ? {} : _ref2$currentTarget;
- var _currentTarget$datase2 = currentTarget.dataset,
- data = _currentTarget$datase2 === undefined ? {} : _currentTarget$datase2;
+ handleNavClick: function handleNavClick(event) {
+ var _ref2 = event.currentTarget || {},
+ _ref2$dataset = _ref2.dataset,
+ dataset = _ref2$dataset === undefined ? {} : _ref2$dataset;
- this.triggerEvent('navclick', { index: data.index });
+ this.triggerEvent('navclick', { index: dataset.index });
},
diff --git a/docs/src/App.vue b/docs/src/App.vue
index d5b87210..f7adff3e 100644
--- a/docs/src/App.vue
+++ b/docs/src/App.vue
@@ -1,5 +1,5 @@
-
+
diff --git a/docs/src/Preview.vue b/docs/src/Preview.vue
new file mode 100644
index 00000000..5bd6cd49
--- /dev/null
+++ b/docs/src/Preview.vue
@@ -0,0 +1,37 @@
+
+
+
![]()
+
+
+
+
+
+
diff --git a/docs/src/doc.config.js b/docs/src/doc.config.js
index cb2ab382..5dfc05c5 100644
--- a/docs/src/doc.config.js
+++ b/docs/src/doc.config.js
@@ -81,10 +81,6 @@ module.exports = {
path: '/steps',
title: 'Steps 步骤条'
},
- {
- path: '/tab',
- title: 'Tab 标签页'
- },
{
path: '/tag',
title: 'Tag 标记'
@@ -94,18 +90,10 @@ module.exports = {
{
groupName: '表单组件',
list: [
- {
- path: '/checkbox',
- title: 'Checkbox 复选框'
- },
{
path: '/field',
title: 'Field 输入框'
},
- {
- path: '/radio',
- title: 'Radio 单选框'
- },
{
path: '/search',
title: 'Search 搜索'
@@ -126,18 +114,6 @@ module.exports = {
{
path: '/actionsheet',
title: 'Actionsheet 上拉菜单'
- },
- {
- path: '/datetime-picker',
- title: 'DatetimePicker 时间选择'
- },
- {
- path: '/dialog',
- title: 'Dialog 弹出框'
- },
- {
- path: '/toast',
- title: 'Toast 轻提示'
}
]
},
diff --git a/docs/src/docs-entry.js b/docs/src/docs-entry.js
index 53c7b4bb..394c0d7b 100644
--- a/docs/src/docs-entry.js
+++ b/docs/src/docs-entry.js
@@ -8,25 +8,19 @@ export default {
'button': () => import('../../packages/button/README.md'),
'card': () => import('../../packages/card/README.md'),
'cell': () => import('../../packages/cell/README.md'),
- 'checkbox': () => import('../../packages/checkbox/README.md'),
'col': () => import('../../packages/col/README.md'),
'common': () => import('../../packages/common/README.md'),
- 'datetime-picker': () => import('../../packages/datetime-picker/README.md'),
- 'dialog': () => import('../../packages/dialog/README.md'),
'field': () => import('../../packages/field/README.md'),
'icon': () => import('../../packages/icon/README.md'),
'loading': () => import('../../packages/loading/README.md'),
'notice-bar': () => import('../../packages/notice-bar/README.md'),
'panel': () => import('../../packages/panel/README.md'),
'popup': () => import('../../packages/popup/README.md'),
- 'radio': () => import('../../packages/radio/README.md'),
'search': () => import('../../packages/search/README.md'),
'stepper': () => import('../../packages/stepper/README.md'),
'steps': () => import('../../packages/steps/README.md'),
'switch': () => import('../../packages/switch/README.md'),
- 'tab': () => import('../../packages/tab/README.md'),
'tag': () => import('../../packages/tag/README.md'),
'toast': () => import('../../packages/toast/README.md'),
- 'toptips': () => import('../../packages/toptips/README.md'),
'tree-select': () => import('../../packages/tree-select/README.md')
};
diff --git a/docs/src/preview.js b/docs/src/preview.js
new file mode 100644
index 00000000..d825e1b8
--- /dev/null
+++ b/docs/src/preview.js
@@ -0,0 +1,7 @@
+import Vue from 'vue';
+import Preview from './Preview.vue';
+
+new Vue({
+ el: '#app',
+ render: h => h(Preview)
+});
diff --git a/example/app.json b/example/app.json
index c23abedf..8deac341 100644
--- a/example/app.json
+++ b/example/app.json
@@ -3,34 +3,26 @@
"pages/dashboard/index",
"pages/actionsheet/index",
"pages/button/index",
- "pages/checkbox/index",
"pages/badge/index",
"pages/card/index",
"pages/cell/index",
- "pages/dialog/index",
"pages/field/index",
- "pages/common/index",
"pages/icon/index",
"pages/layout/index",
"pages/loading/index",
"pages/notice-bar/index",
"pages/panel/index",
"pages/popup/index",
- "pages/radio/index",
"pages/stepper/index",
"pages/steps/index",
"pages/switch/index",
"pages/search/index",
- "pages/tab/index",
"pages/tag/index",
- "pages/toptips/index",
- "pages/toast/index",
- "pages/tree-select/index",
- "pages/datetime/index"
+ "pages/tree-select/index"
],
"window": {
"navigationBarBackgroundColor": "#FAFAFA",
- "navigationBarTitleText": "vant-weapp",
+ "navigationBarTitleText": "Vant Weapp",
"navigationBarTextStyle": "black",
"backgroundTextStyle": "dark",
"backgroundColor": "#f8f8f8"
diff --git a/example/pages/checkbox/index.js b/example/pages/checkbox/index.js
deleted file mode 100644
index eeeb5de5..00000000
--- a/example/pages/checkbox/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-var Zan = require('../../dist/index');
-
-Page({
-
- data: {
- items: [
- {value: 'a'},
- {value: 'b', checked: true},
- {value: 'c'},
- ]
- },
-
- handleCheckboxChange: function(e) {
- console.log('checkbox发生change事件,携带value值为:', e.detail)
- console.log('items:', this.data.items)
- }
-});
diff --git a/example/pages/checkbox/index.json b/example/pages/checkbox/index.json
deleted file mode 100644
index 61200cbf..00000000
--- a/example/pages/checkbox/index.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "navigationBarTitleText": "Checkbox 选择",
- "usingComponents": {
- "van-checkbox-group": "../../dist/checkbox-group/index",
- "van-checkbox": "../../dist/checkbox/index",
- "van-panel": "../../dist/panel/index",
- "van-cell": "../../dist/cell/index"
- }
-}
diff --git a/example/pages/checkbox/index.wxml b/example/pages/checkbox/index.wxml
deleted file mode 100644
index a62a0135..00000000
--- a/example/pages/checkbox/index.wxml
+++ /dev/null
@@ -1,41 +0,0 @@
-
- 复选框
-
-
-
- 复选框
-
-
-
- 复选框
-
-
-
-
- 复选框 {{ item.value }}
-
-
-
-
- 复选框 a
- 复选框 b
- 复选框 c
-
diff --git a/example/pages/checkbox/index.wxss b/example/pages/checkbox/index.wxss
deleted file mode 100644
index f4a72014..00000000
--- a/example/pages/checkbox/index.wxss
+++ /dev/null
@@ -1,4 +0,0 @@
-.checkbox-demo {
- display: block;
- margin: 15px 0;
-}
diff --git a/example/pages/common/index.js b/example/pages/common/index.js
deleted file mode 100644
index 560d44d4..00000000
--- a/example/pages/common/index.js
+++ /dev/null
@@ -1 +0,0 @@
-Page({});
diff --git a/example/pages/common/index.json b/example/pages/common/index.json
deleted file mode 100644
index 8286c3ac..00000000
--- a/example/pages/common/index.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "navigationBarTitleText": "内置样式",
- "usingComponents": {
- "demo-block": "../../components/demo-block/index"
- }
-}
diff --git a/example/pages/common/index.wxml b/example/pages/common/index.wxml
deleted file mode 100644
index 41349a6c..00000000
--- a/example/pages/common/index.wxml
+++ /dev/null
@@ -1,7 +0,0 @@
-
- 这是一段宽度限制 250px 的文字,后面的内容会省略
-
-
-
-
-
diff --git a/example/pages/common/index.wxss b/example/pages/common/index.wxss
deleted file mode 100644
index 17d5b93c..00000000
--- a/example/pages/common/index.wxss
+++ /dev/null
@@ -1,14 +0,0 @@
-.ellipsis {
- font-size: 13px;
- margin-left: 15px;
- max-width: 250px;
-}
-
-.hairline {
- height: 30px;
- background-color: #fff;
-}
-
-.hairline::after {
- top: 15px;
-}
diff --git a/example/pages/dashboard/config.js b/example/pages/dashboard/config.js
index 1e9783ef..9ad7cd80 100644
--- a/example/pages/dashboard/config.js
+++ b/example/pages/dashboard/config.js
@@ -2,10 +2,6 @@ export default {
base: {
title: '基础组件',
content: [
- {
- name: '内置样式',
- path: '/pages/common/index'
- },
{
name: 'Layout 布局',
path: '/pages/layout/index'
@@ -46,10 +42,6 @@ export default {
name: 'Steps 步骤条',
path: '/pages/steps/index'
},
- {
- name: 'Tab 标签',
- path: '/pages/tab/index'
- },
{
name: 'Tag 标记',
path: '/pages/tag/index'
@@ -59,18 +51,10 @@ export default {
form: {
title: '表单',
content: [
- {
- name: 'Checkbox 复选框',
- path: '/pages/checkbox/index'
- },
{
name: 'Field 输入框',
path: '/pages/field/index'
},
- {
- name: 'Radio 单选框',
- path: '/pages/radio/index'
- },
{
name: 'Search 搜索',
path: '/pages/search/index'
@@ -91,22 +75,6 @@ export default {
{
name: 'Actionsheet 上拉菜单',
path: '/pages/actionsheet/index'
- },
- {
- name: 'Dialog 弹出框',
- path: '/pages/dialog/index'
- },
- {
- name: 'DatetimePicker 时间选择器',
- path: '/pages/datetime/index'
- },
- {
- name: 'Toast 轻提示',
- path: '/pages/toast/index'
- },
- {
- name: 'TopTips 顶部提示',
- path: '/pages/toptips/index'
}
]
},
diff --git a/example/pages/datetime/index.js b/example/pages/datetime/index.js
deleted file mode 100644
index fb9e2d00..00000000
--- a/example/pages/datetime/index.js
+++ /dev/null
@@ -1,21 +0,0 @@
-Page({
- onLoad () {
- setTimeout(() => {
- this.setData({
- date: new Date('2300/12/12').getTime()
- })
- }, 100)
- },
-
- customChange ({detail}) {
- this.setData({pickerView1: detail.value.join('-')})
- },
-
- nativeChange ({detail}) {
- this.setData({pickerView2: detail.value.join('-')})
- },
-
- change ({ detail: { value, date } }) {
- console.log('value is', value, 'and date is', date)
- }
-})
\ No newline at end of file
diff --git a/example/pages/datetime/index.json b/example/pages/datetime/index.json
deleted file mode 100644
index 6588475b..00000000
--- a/example/pages/datetime/index.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "navigationBarTitleText": "时间选择器",
- "usingComponents": {
- "van-date-picker": "../../dist/datetime-picker/index",
- "van-cell": "../../dist/cell/index",
- "van-cell-group": "../../dist/cell-group/index",
- "van-panel": "../../dist/panel/index"
- }
-}
\ No newline at end of file
diff --git a/example/pages/datetime/index.wxml b/example/pages/datetime/index.wxml
deleted file mode 100644
index af8ae339..00000000
--- a/example/pages/datetime/index.wxml
+++ /dev/null
@@ -1,55 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/example/pages/datetime/index.wxss b/example/pages/datetime/index.wxss
deleted file mode 100644
index 389986e6..00000000
--- a/example/pages/datetime/index.wxss
+++ /dev/null
@@ -1,9 +0,0 @@
-.my-customer-class {
- font-size: 16px;
- margin-top: 15px;
- margin-left: 15px;
-}
-.picker-panel-demo {
- display: block;
- margin-top: 15px;
-}
\ No newline at end of file
diff --git a/example/pages/dialog/index.js b/example/pages/dialog/index.js
deleted file mode 100644
index 18d3e990..00000000
--- a/example/pages/dialog/index.js
+++ /dev/null
@@ -1,140 +0,0 @@
-const Dialog = require('../../dist/dialog/dialog');
-const Toast = require('../../dist/toast/toast');
-
-Page({
- toggleBaseDialog() {
- Dialog({
- title: '弹窗',
- message: '这是一个模态弹窗\n换行',
- selector: '#van-base-dialog',
- showCancelButton: true
- }).then(() => {
- console.log('=== dialog resolve ===', 'type: confirm');
- }).catch(() => {
- console.log('=== dialog reject ===', 'type: cancel');
- });
- },
-
- toggleWithoutTitleDialog() {
- Dialog({
- message: '这是一个模态弹窗',
- selector: '#van-no-title-dialog'
- }).then(() => {
- console.log('=== dialog ===', 'type: confirm');
- });
- },
-
- toggleButtonDialog() {
- Dialog({
- title: '弹窗',
- message: '这是一个模态弹窗',
- selector: '#van-button-dialog',
- buttons: [{
- text: '现金支付',
- color: 'red',
- type: 'cash'
- }, {
- text: '分享',
- type: 'share',
- openType: 'share'
- }, {
- text: '微信支付',
- color: '#3CC51F',
- type: 'wechat'
- }, {
- text: '取消',
- type: 'cancel'
- }]
- }).then(({ type }) => {
- console.log('=== dialog with custom buttons ===', `type: ${type}`);
- });
- },
-
- toggleVerticalDialog() {
- Dialog({
- title: '弹窗',
- message: '这是一个模态弹窗',
- selector: '#van-vertical-dialog',
- buttonsShowVertical: true,
- buttons: [{
- text: '现金支付',
- color: 'red',
- type: 'cash'
- }, {
- text: '微信支付',
- color: '#3CC51F',
- type: 'wechat'
- }, {
- text: '分享',
- type: 'share',
- openType: 'share'
- }, {
- text: '取消',
- type: 'cancel'
- }]
- }).then(({ type }) => {
- console.log('=== dialog with vertical buttons ===', `type: ${type}`);
- });
- },
-
- toggleOpenDialog() {
- Dialog({
- title: '弹窗',
- message: '获取用户数据',
- selector: '#van-open-dialog',
- buttons: [{
- text: '用户信息',
- type: 'userInfo',
- openType: 'getUserInfo'
- }, {
- text: '获取手机号',
- type: 'tel',
- openType: 'getPhoneNumber'
- }, {
- text: '打开授权页',
- type: 'setting',
- openType: 'openSetting'
- }]
- }).then(({ type, hasOpenDataPromise, openDataPromise }) => {
- console.log(type);
-
- // 如果没有 open 数据返回,就不处理
- if (!hasOpenDataPromise) {
- return;
- }
-
- openDataPromise.then((data) => {
- console.log('成功获取信息', data);
- }).catch((data) => {
- console.log('获取信息失败', data);
- });
- });
- },
-
- toggleCloseDialog() {
- Dialog({
- title: '弹窗',
- message: '这是一个自由控制关闭的弹窗',
- selector: '#van-close-dialog',
- autoClose: false
- }).then(() => {
- console.log('=== dialog resolve ===', 'type: confirm');
- Toast.loading({
- selector: '#van-toast'
- });
-
- // 2s 后自动关闭弹窗
- setTimeout(() => {
- Dialog.close({ selector: '#van-close-dialog' });
- Toast.clear();
- }, 2000);
- });
- },
-
- onShareAppMessage() {
- return {
- title: 'vant-weapp',
- imageUrl: 'https://img.yzcdn.cn/public_files/2017/02/06/ee0ebced79a80457d77ce71c7d414c74.png'
- };
- },
-});
diff --git a/example/pages/dialog/index.json b/example/pages/dialog/index.json
deleted file mode 100644
index 5901434a..00000000
--- a/example/pages/dialog/index.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "navigationBarTitleText": "Dialog 弹出框",
- "usingComponents": {
- "van-dialog": "../../dist/dialog/index",
- "van-button": "../../dist/button/index",
- "van-toast": "../../dist/toast/index"
- }
-}
diff --git a/example/pages/dialog/index.wxml b/example/pages/dialog/index.wxml
deleted file mode 100644
index 5d8ceb57..00000000
--- a/example/pages/dialog/index.wxml
+++ /dev/null
@@ -1,17 +0,0 @@
-
-基础 Dialog
-Dialog - 无标题
-Dialog - 自定义显示按钮
-Dialog - 按钮纵向排布
-Dialog - 获取 Open 数据的弹窗
-Dialog - 控制弹窗关闭
-
-
-
-
-
-
-
-
-
-
diff --git a/example/pages/radio/index.js b/example/pages/radio/index.js
deleted file mode 100644
index 0ed7cd12..00000000
--- a/example/pages/radio/index.js
+++ /dev/null
@@ -1,19 +0,0 @@
-Page({
-
- data: {
- items: [
- {name: 'USA', value: '美国'},
- {name: 'CHN', value: '中国', checked: 'true'}
- ],
-
- items1: [
- {name: 'USA', value: '美国'},
- {name: 'BRA', value: '巴西', disabled: true },
- {name: 'CHN', value: '中国', checked: 'true'}
- ]
- },
-
- handleRadioChange: function(e) {
- console.log('radio发生change事件,携带value值为:', e.detail)
- }
-});
diff --git a/example/pages/radio/index.json b/example/pages/radio/index.json
deleted file mode 100644
index 4dfe74e0..00000000
--- a/example/pages/radio/index.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "navigationBarTitleText": "Radio 单选框",
- "usingComponents": {
- "van-radio": "../../dist/radio/index",
- "van-panel": "../../dist/panel/index",
- "van-cell": "../../dist/cell/index"
- }
-}
diff --git a/example/pages/radio/index.wxml b/example/pages/radio/index.wxml
deleted file mode 100644
index 7ba9abc0..00000000
--- a/example/pages/radio/index.wxml
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/example/pages/radio/index.wxss b/example/pages/radio/index.wxss
deleted file mode 100644
index ab86a7bb..00000000
--- a/example/pages/radio/index.wxss
+++ /dev/null
@@ -1,8 +0,0 @@
-.radio-demo {
- font-size: 12px !important;
-}
-
-.radio-color {
- background-color: red !important;
- border-color: red !important;
-}
diff --git a/example/pages/tab/index.js b/example/pages/tab/index.js
deleted file mode 100644
index 17b61846..00000000
--- a/example/pages/tab/index.js
+++ /dev/null
@@ -1,57 +0,0 @@
-Page({
- data: {
- tab: {
- list: [{
- id: 1,
- title: '选项1'
- }, {
- id: 2,
- title: '选项2'
- }, {
- id: 3,
- title: '选项3'
- }],
- selectedId: 1
- },
- tab1: {
- list: [{
- id: 'all',
- title: '全部'
- }, {
- id: 'topay',
- title: '待付款'
- }, {
- id: 'tosend',
- title: '待发货'
- }, {
- id: 'send',
- title: '待收货'
- }],
- selectedId: 'all'
- },
- tab2: {
- list: [{
- id: '1',
- title: '最新商品1'
- }, {
- id: '2',
- title: '最新商品2'
- }, {
- id: '3',
- title: '最新商品3'
- }, {
- id: '4',
- title: '最新商品4'
- }, {
- id: '5',
- title: '最新商品5'
- }, {
- id: '6',
- title: '最新商品6'
- }],
- selectedId: '1',
- scroll: true,
- height: 45
- }
- }
-});
diff --git a/example/pages/tab/index.json b/example/pages/tab/index.json
deleted file mode 100644
index af23d765..00000000
--- a/example/pages/tab/index.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "navigationBarTitleText": "Tab 标签",
- "usingComponents": {
- "van-tab": "../../dist/tab/index"
- }
-}
diff --git a/example/pages/tab/index.wxml b/example/pages/tab/index.wxml
deleted file mode 100644
index 5d70cf99..00000000
--- a/example/pages/tab/index.wxml
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/example/pages/tab/index.wxss b/example/pages/tab/index.wxss
deleted file mode 100644
index e69de29b..00000000
diff --git a/example/pages/toast/index.js b/example/pages/toast/index.js
deleted file mode 100644
index 704b70ff..00000000
--- a/example/pages/toast/index.js
+++ /dev/null
@@ -1,59 +0,0 @@
-const Toast = require('../../dist/toast/toast');
-
-Page({
- data: {},
-
- showToast() {
- Toast.setDefaultOptions({
- selector: '#van-toast-test'
- });
-
- Toast('toast的内容');
- },
-
- showIconToast() {
- Toast({
- type: 'fail',
- message: 'toast的内容',
- selector: '#van-toast-test'
- });
- },
-
- showImageToast() {
- Toast({
- message: 'toast的内容',
- selector: '#van-toast-test',
- image: 'https://b.yzcdn.cn/v2/image/dashboard/secured_transaction/suc_green@2x.png'
- });
- },
-
- showLoadingToast() {
- Toast({
- type: 'loading',
- message: 'toast的内容',
- selector: '#van-toast-test'
- });
- },
-
- showOnlyIcon() {
- Toast({
- type: 'fail',
- selector: '#van-toast-test'
- });
- },
-
- showEverToast() {
- Toast({
- message: 'toast的内容',
- selector: '#van-toast-test',
- timeout: -1
- });
- },
-
- showLoading() {
- Toast.loading({
- message: '加载中',
- selector: '#van-toast-test'
- });
- }
-});
diff --git a/example/pages/toast/index.json b/example/pages/toast/index.json
deleted file mode 100644
index 03b83c10..00000000
--- a/example/pages/toast/index.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "navigationBarTitleText": "Toast 轻提示",
- "usingComponents": {
- "van-button": "../../dist/button/index",
- "van-toast": "../../dist/toast/index"
- }
-}
diff --git a/example/pages/toast/index.wxml b/example/pages/toast/index.wxml
deleted file mode 100644
index 7b48862c..00000000
--- a/example/pages/toast/index.wxml
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-
-
- 显示toast
-
-
-
- 显示 Icon 图标的toast
-
-
-
- 自定义图片作为图标的toast
-
-
-
- 显示 Loading toast
-
-
-
- 只显示图标的toast
-
-
-
- 不消失的的toast
-
-
-
- 显示 Loading
-
-
-
-
-
diff --git a/example/pages/toptips/index.js b/example/pages/toptips/index.js
deleted file mode 100644
index fbc0de4f..00000000
--- a/example/pages/toptips/index.js
+++ /dev/null
@@ -1,44 +0,0 @@
-const Toptips = require('../../dist/toptips/toptips');
-
-Page({
- data: {
- content: '测试toptips',
- duration: 2000,
- $vant: {
- toptips: {
- show: false
- }
- }
- },
-
- showTopTips() {
- this.setData({
- $vant: {
- toptips: {
- show: true
- }
- }
- });
-
- setTimeout(() => {
- this.setData({
- $vant: {
- toptips: {
- show: false
- }
- }
- });
- },this.data.duration);
- },
-
- showTopTips2() {
- Toptips('测试内容');
- },
-
- showTopTips3() {
- Toptips({
- duration: 1000,
- content: '测试时间1秒'
- })
- }
-});
diff --git a/example/pages/toptips/index.json b/example/pages/toptips/index.json
deleted file mode 100644
index 5c9f2d04..00000000
--- a/example/pages/toptips/index.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "navigationBarTitleText": "Toptips 顶部提示",
- "usingComponents": {
- "van-button": "../../dist/button/index",
- "van-toptips": "../../dist/toptips/index"
- }
-}
diff --git a/example/pages/toptips/index.wxml b/example/pages/toptips/index.wxml
deleted file mode 100644
index 2204accc..00000000
--- a/example/pages/toptips/index.wxml
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
- 显示toptips,声明式调用
-
-
-
-
-
- 显示toptips,命令式调用
-
-
-
-
-
- 显示toptips,持续一秒
-
-
-
-
-
-
diff --git a/package.json b/package.json
index 32332c71..93b38d53 100644
--- a/package.json
+++ b/package.json
@@ -10,7 +10,7 @@
"lint": "eslint ./packages --ext .js",
"release": "sh scripts/release.sh",
"build": "sh scripts/deploy.sh",
- "build:lib": "cross-env NODE_ENV=production node scripts/build-components.js --color",
+ "build:lib": "cross-env NODE_ENV=production node build/build-components.js --color",
"build:site": "rm -rf docs/dist && cross-env NODE_ENV=production webpack --config build/webpack.doc.js && gh-pages -d docs/dist"
},
"files": [
diff --git a/packages/checkbox-group/index.js b/packages/checkbox-group/index.js
deleted file mode 100644
index a40a89f4..00000000
--- a/packages/checkbox-group/index.js
+++ /dev/null
@@ -1,26 +0,0 @@
-const CHECKBOX_PATH = '../checkbox/index';
-
-Component({
- relations: {
- [CHECKBOX_PATH]: {
- type: 'child',
- linked() {
- this.updateChildren(CHECKBOX_PATH);
- }
- }
- },
-
- data: {
- elementUpdateTimeout: 0
- },
-
- methods: {
- updateChildren(childPath) { // 把checkbox标记为在group中,设置不同样式
- const elements = this.getRelationNodes(childPath);
-
- elements.forEach((checkbox, index) => {
- checkbox.updateData({ isInGroup: true });
- });
- }
- }
-});
diff --git a/packages/checkbox-group/index.json b/packages/checkbox-group/index.json
deleted file mode 100644
index 32640e0d..00000000
--- a/packages/checkbox-group/index.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "component": true
-}
\ No newline at end of file
diff --git a/packages/checkbox-group/index.pcss b/packages/checkbox-group/index.pcss
deleted file mode 100644
index 2c698c13..00000000
--- a/packages/checkbox-group/index.pcss
+++ /dev/null
@@ -1,7 +0,0 @@
-.checkbox-group {
- padding-bottom: 10px;
- background-color: #fff;
-}
-.checkbox-group .van-checkbox {
- margin-top: 10px;
-}
diff --git a/packages/checkbox-group/index.wxml b/packages/checkbox-group/index.wxml
deleted file mode 100644
index a6ef51f8..00000000
--- a/packages/checkbox-group/index.wxml
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
diff --git a/packages/checkbox/README.md b/packages/checkbox/README.md
deleted file mode 100644
index 159ec46a..00000000
--- a/packages/checkbox/README.md
+++ /dev/null
@@ -1,100 +0,0 @@
-## Checkbox 复选框
-
-### 使用指南
-在 index.json 中引入组件
-```json
-{
- "usingComponents": {
- "van-checkbox": "/packages/checkbox/index"
- }
-}
-```
-
-### 代码演示
-
-#### 基础用法
-
-```html
-复选框
-```
-
-#### 基础用法
-
-```html
-复选框
-```
-
-#### 禁用状态
-
-```html
-复选框
-```
-
-#### 禁用内容部分点击事件
-
-```html
-复选框
-```
-
-#### Checkbox组
-
-```html
-
- 复选框 {{ item.name }}
-
-```
-
-```js
-Page({
- data: {
- items: [
- {value: 'a'},
- {value: 'b', checked: true},
- {value: 'c'},
- ]
- }
-});
-```
-
-#### 列表模式
-
-```html
-复选框 a
-复选框 b
-复选框 c
-```
-
-### 参数
-| 参数 | 说明 | 类型 | 默认值 | 必须 |
-|-----------|-----------|-----------|-------------|-------------|
-| checked | 是否选中 | Boolean| false | |
-| disabled | 是否可用 | Boolean| false | |
-| labelDisabled | 文字区域是否可选 | Boolean | false | |
-| type | 显示类型 | String | - | |
-
-### 事件
-
-| 事件名称 | 说明 | 回调参数 |
-| ---- | --- | ---|
-| change | 数值改变时修改 | checked值|
diff --git a/packages/checkbox/index.js b/packages/checkbox/index.js
deleted file mode 100644
index af802490..00000000
--- a/packages/checkbox/index.js
+++ /dev/null
@@ -1,42 +0,0 @@
-const CHECKBOX_GROUP_PATH = '../checkbox-group/index';
-
-Component({
- externalClasses: ['checkbox-class'],
- relations: {
- [CHECKBOX_GROUP_PATH]: {
- type: 'parent'
- }
- },
-
- properties: {
- checked: Boolean,
- disabled: Boolean,
- isInGroup: Boolean,
- labelDisabled: Boolean,
- type: String
- },
-
- data() {
- return {
- isInGroup: false,
- isInCell: false
- };
- },
-
- methods: {
- handleClick() {
- if (this.data.disabled) {
- return;
- }
-
- const checked = !this.data.checked;
-
- this.triggerEvent('change', checked);
- this.setData({ checked });
- },
-
- updateData(data) {
- this.setData(data);
- }
- }
-});
diff --git a/packages/checkbox/index.json b/packages/checkbox/index.json
deleted file mode 100644
index 0a336c08..00000000
--- a/packages/checkbox/index.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "component": true,
- "usingComponents": {
- "van-icon": "../icon/index"
- }
-}
diff --git a/packages/checkbox/index.pcss b/packages/checkbox/index.pcss
deleted file mode 100644
index 00fbdf0b..00000000
--- a/packages/checkbox/index.pcss
+++ /dev/null
@@ -1,39 +0,0 @@
-.van-checkbox {
- display: inline-block;
- padding: 0 10px;
- font-size: 14px;
-
- &__item {
- display: block;
- margin-top: 10px;
- }
-
- &__list-item {
- display: block;
- padding: 10px 10px 10px 0;
- margin-left: 10px;
- border-bottom: 1px solid #e5e5e5;
- .van-checkbox__icon {
- float: right;
- }
- }
-
- &__icon {
- display: inline-flex;
- align-items: center;
- color: #aaa;
-
- &.van-checkbox--checked {
- color: #06bf04;
- }
-
- &.van-checkbox--disabled {
- color: #e5e5e5;
- }
- }
-
- &__label {
- display: inline-block;
- margin-left: 10px;
- }
-}
diff --git a/packages/checkbox/index.wxml b/packages/checkbox/index.wxml
deleted file mode 100644
index 311ccbb9..00000000
--- a/packages/checkbox/index.wxml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
diff --git a/packages/datetime-picker/README.md b/packages/datetime-picker/README.md
deleted file mode 100644
index d898cec3..00000000
--- a/packages/datetime-picker/README.md
+++ /dev/null
@@ -1,49 +0,0 @@
-## DatetimePicker 时间选择
-
-使用 picker 组件开发的时间日期组件,弥补小程序 picker 自身对于快速时间选择的不支持。
-
-### 使用指南
-
-在 index.json 中引入组件
-```json
-{
- "usingComponents": {
- "van-date-picker": "path/to/vant-weapp/dist/datetime-picker/index"
- }
-}
-```
-
-### 代码演示
-可以在任意位置上使用 van-date-picker 标签。
-```wxml
-
-```
-
-### 属性与事件
-
-| 名称 | 类型 | 是否必须 | 默认 | 描述 |
-| ----------------- | --------- | -------- | ------------------- | ----------------------------------------------------------------------------------------------------- |
-| date | `String` | `否` | 当前时间 | 初始化时间,传入的值会被 Date 构造函数转换为一个 Date 对象,不合法的值将抛出一个错误 |
-| placeholder-class | `String` | `否` | 无 | 自定义类,可改变 placeholder 样式,其他类无效,`picker-view` 为 true 时不支持 |
-| placeholder | `String` | `否` | 请选择时间 | 设置 picker 的 placeholder,`picker-view` 为 true 时不支持 |
-| not-use | `Array` | `否` | 无 | 不需要显示的列 可选择`years`, `months`, `days`, `hours`, `minutes`, `seconds`中的多个 |
-| picker-view | `Boolean` | `否` | 无 | 如果为 true,相当于 picker-view 组件 |
-| format | `String` | `否` | YYYY-MM-DD HH:mm:ss | 设置选中的时间显示的格式,支持 _YYYY,yyyy,YY,yy,MM,M,DD,dd,D,d,HH, hh,H,h,mm,m,ss,s_ |
-| bindchange | `String` | `是` | 无 | 用户点击`确认`触发该事件,返回值为按“年,月,日,时,分,秒”顺序的数组,可以通过`detail.value`获取;3.0.8 后新增 date 值,表示当前选择时间的对象 |
-| bindcancel | `String` | `否` | 无 | 用户点击`取消`触发该事件 |
-
-### 方法
-
-| 名称 | 参数 | 描述 |
-| ------------ | ---- | --------------------------------------------------------------- |
-| getFormatStr | 无 | 返回 `format` 格式的字符串,在 `picker-view` 为 true 时比较实用 |
-
-### 增强优化
-
-支持可选择时间区域限制
diff --git a/packages/datetime-picker/date-picker-view.wxml b/packages/datetime-picker/date-picker-view.wxml
deleted file mode 100644
index 0a69f841..00000000
--- a/packages/datetime-picker/date-picker-view.wxml
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/packages/datetime-picker/date-picker.js b/packages/datetime-picker/date-picker.js
deleted file mode 100644
index ba266e56..00000000
--- a/packages/datetime-picker/date-picker.js
+++ /dev/null
@@ -1,97 +0,0 @@
-const LIMIT_YEAR_COUNT = 50;
-const { genNumber, iso2utc } = require('./utils')
-
-module.exports = class DatePicker {
- constructor(date = new Date()) {
- this.types = ['year', 'month', 'day', 'hour', 'minute', 'second'];
- this.months = genNumber(1, 12, 2);
- this.hours = genNumber(0, 23, 2);
- this.seconds = genNumber(0, 59, 2);
- this.minutes = genNumber(0, 59, 2);
- this._date = date
- }
-
- getYears(year) {
- let mid = Math.floor(LIMIT_YEAR_COUNT / 2);
- let min = year - mid;
- let max = year + (LIMIT_YEAR_COUNT - mid);
- return genNumber(min, max, 4);
- }
-
- lastDay(year, month) {
- return month !== 12 ? new Date(
- new Date(`${year}/${month + 1}/1`).getTime() - (24 * 60 * 60 * 1000)
- ).getDate() : 31;
- }
-
- getData (date) {
- date = date || this._date || new Date
-
- // toUTCString ISO 格式部分 ios 手机会失败
- if (new Date(date).toString() === 'Invalid Date' && typeof date === 'string' && date.indexOf('-') > 0) {
- date = iso2utc(date)
- }
-
- let d = new Date(date);
-
- let y = d.getFullYear();
- let m = d.getMonth() + 1;
- let years = this.getYears(y);
- let lastDay = this.lastDay(y, m);
- let days = genNumber(1, lastDay, 2);
-
- this._years = years;
- this._dataList = [years, this.months, days, this.hours, this.minutes, this.seconds];
- this._indexs = [25, m - 1, d.getDate() - 1, d.getHours(), d.getMinutes(), d.getSeconds()];
-
- return {
- dataList: this._dataList,
- selected: this._indexs
- }
- }
-
- update(col, index) {
- let type = this.types[col];
- switch (type) {
- case 'year':
- return this._updateYear(col, index);
- case 'month':
- return this._updateMonth(col, index);
- default:
- this._indexs[col] = index;
- return [{ col, index }]
- }
- }
-
- _updateYear(col, index, cb) {
- let years = this._dataList[col];
- let year = years[index];
-
- this._dataList[col] = this.getYears(+year);
-
- this._indexs[col] = Math.floor(LIMIT_YEAR_COUNT / 2);
-
- return [{ col: 0, index: this._indexs[col], data: this._dataList[col] }]
- }
-
- _updateMonth(col, index) {
- let month = this._dataList[col][index];
- let year = this._dataList[0][this._indexs[0]];
- let lastDay = this.lastDay(+year, +month);
- this._indexs[col] = index;
- this._dataList[2] = genNumber(1, lastDay, 2);
- this._indexs[2] = this._indexs[2] >= this._dataList[2].length ? this._dataList[2].length - 1 : this._indexs[2];
-
- return [
- {
- col: 1,
- index
- },
- {
- col: 2,
- index: this._indexs[2],
- data: this._dataList[2]
- }
- ]
- }
-}
\ No newline at end of file
diff --git a/packages/datetime-picker/index.js b/packages/datetime-picker/index.js
deleted file mode 100644
index aa674458..00000000
--- a/packages/datetime-picker/index.js
+++ /dev/null
@@ -1,181 +0,0 @@
-const DatePicker = require('./date-picker')
-const { genNumber, moment } = require('./utils')
-
-
-Component({
- properties: {
- placeholder: {
- type: String,
- value: '请选择时间'
- },
- format: {
- type: String,
- value: 'YYYY-MM-DD HH:mm:ss'
- },
- pickerView: {
- type: Boolean
- },
- date: {
- type: String,
- observer(value) {
- if (value === ({}).toString()) {
- throw new Error('参数必须是一个字符串')
- }
- if (/^[0-9]+$/.test(value)) {
- value = +value
- }
- !this._inited && this._init()
- this.updateDate(value)
- }
- },
- notUse: {
- type: Array
- }
- },
- externalClasses: ['placeholder-class'],
- data: {
- transPos: [0, 0, 0, 0, 0, 0]
- },
- attached() {
- !this._inited && this._init()
- },
-
- methods: {
- _init () {
- this._inited = true
- this.use = {};
-
- ['years', 'months', 'days', 'hours', 'minutes', 'seconds'].forEach((item) => {
- if ((this.data.notUse || []).indexOf(item) === -1) {
- this.use[item] = true
- }
- });
-
- this.picker = new DatePicker(this.data.date)
-
- let { dataList, selected } = this.picker.getData(this.data.date)
-
- // 鬼他么知道为什么 dataList, selected 不能一起 setData
- this.setData({
- use: this.use,
- dataList
- }, () => {
- this.setData({
- selected
- })
- });
-
- this._indexs = selected
- },
- updatePicker(updateData = []) {
- let _updateData = {};
-
- for (const { col, index, data } of updateData) {
- if (~index && this._indexs[col] !== index || col === 0) {
- _updateData[`selected[${col}]`] = index // 更新索引
- this._indexs[col] = index
- }
-
- if (data) {
- _updateData[`dataList[${col}]`] = data;
- }
- }
-
- this.setData(_updateData);
- },
-
- updateDate (date) {
- let { dataList, selected } = this.picker.getData(date)
- this._indexs = selected
-
- // 好像必须要等到 datalist 完成
- this.setData({ dataList }, () => {
- this.setData({
- selected,
- text: this.getFormatStr()
- })
- })
- },
-
- getFormatStr() {
- let date = new Date();
- ['FullYear', 'Month', 'Date', 'Hours', 'Minutes', 'Seconds'].forEach((key, index) => {
- let value = this.data.dataList[index][this._indexs[index]];
- if (key === 'Month') {
- value = +this.data.dataList[index][this._indexs[index]] - 1;
- }
- date[`set${key}`](+value);
- });
-
- return moment(date, this.data.format);
- },
-
- showPicker() {
- this.setData({
- show: true
- });
- },
-
- hidePicker(e) {
- let { action } = e.currentTarget.dataset;
-
- this.setData({
- show: false
- });
-
- if (action === 'cancel') {
- this.cancel({
- detail: {}
- });
- } else {
- this.change({
- detail: {
- value: this._indexs
- }
- });
- }
- },
-
- columnchange(e) {
- let { column, value } = e.detail;
- let updateData = this.picker.update(column, value);
- this.updatePicker(updateData)
- },
-
- change(e) {
- let { value } = e.detail;
-
- let data = this.data.dataList.map((item, index) => {
- return +item[value[index]];
- });
-
- let day = data.slice(0, 3)
- let time = data.slice(3, 6)
- let date = new Date(`${ day.join('/') } ${ time.join(':') }`)
-
- this.triggerEvent('change', {
- value: data,
- date
- });
-
- // 手动触发 columnchange
- for (let index = 0; index < value.length; index++) {
- if (this._indexs[index] !== value[index]) {
- this.columnchange({
- detail: {
- column: index,
- value: value[index]
- }
- })
- }
- }
-
- this.setData({
- text: this.getFormatStr()
- });
- },
- cancel(e) {
- this.triggerEvent('cancel', e.detail);
- }
- }
-});
diff --git a/packages/datetime-picker/index.json b/packages/datetime-picker/index.json
deleted file mode 100644
index 10d4a702..00000000
--- a/packages/datetime-picker/index.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "component": true,
- "usingComponents": {
- "pop-manager": "../common/pop-manager/index"
- }
-}
\ No newline at end of file
diff --git a/packages/datetime-picker/index.wxml b/packages/datetime-picker/index.wxml
deleted file mode 100644
index 2bba4abb..00000000
--- a/packages/datetime-picker/index.wxml
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-{{text || placeholder}}
-
-
-
-
-
-
-
-
- 取消
- 确认
-
-
-
-
-
\ No newline at end of file
diff --git a/packages/datetime-picker/index.wxss b/packages/datetime-picker/index.wxss
deleted file mode 100644
index fe180685..00000000
--- a/packages/datetime-picker/index.wxss
+++ /dev/null
@@ -1,53 +0,0 @@
-.picker-visible {
- height: 236px;
- bottom: 0;
-}
-
-picker-view-column.year-view-column {
- width: 50px;
- flex: 2;
-}
-picker-view-column {
- width: 30px;
- text-align: center;
-}
-.hidden {
- display: none;
-}
-.view-column-tip {
- height: 235px;
- line-height: 235px;
- margin: 0 5px;
-}
-
-.picker {
- width: 100vw;
- height: 100vh;
- top: 0;
- left: 0;
- z-index: 12;
-}
-
-.picker .picker-action {
- height: 36px;
- bottom: 235px;
- padding: 0 15px;
- width: 100%;
- display: flex;
- align-items: center;
- position: absolute;
- background: #fff;
- box-sizing: border-box;
- border-bottom: 1rpx solid #e5e5e5;
- justify-content: space-between;
-}
-.picker-action view:last-child {
- color: #1aad16;
-}
-
-.picker picker-view {
- position: absolute;
- bottom: 0;
- background: #fff;
- width: 100vw;
-}
\ No newline at end of file
diff --git a/packages/datetime-picker/picker-view-column.wxml b/packages/datetime-picker/picker-view-column.wxml
deleted file mode 100644
index 9f407a04..00000000
--- a/packages/datetime-picker/picker-view-column.wxml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
- {{item}}
-
- {{ tip }}
-
\ No newline at end of file
diff --git a/packages/datetime-picker/utils.js b/packages/datetime-picker/utils.js
deleted file mode 100644
index 47f63cb2..00000000
--- a/packages/datetime-picker/utils.js
+++ /dev/null
@@ -1,79 +0,0 @@
-function partStartWithZero(num, strlen) {
- let zeros = '';
- while (zeros.length < strlen) {
- zeros += '0';
- }
- return (zeros + num).slice(-strlen);
-}
-
-module.exports.genNumber = function genNumber(begin, end, strlen) {
- let nums = [];
- while (begin <= end) {
- nums.push(partStartWithZero(begin, strlen));
- begin++;
- }
- return nums;
-}
-
-module.exports.moment = function moment(date, formatStr = 'YYYY:MM:DD') {
- if (!date && date !== 0) date = new Date();
-
- date = new Date(date);
- if (date.toString() === 'Invalid Date') throw new Error('Invalid Date');
-
- let getDateValue = (method, fn) => (fn ? fn(date[`get${method}`]()) : date[`get${method}`]());
- let map = new Map();
-
- map.set(/(Y+)/i, () => getDateValue('FullYear', year => (year + '').substr(4 - RegExp.$1.length)));
- map.set(/(M+)/, () => getDateValue('Month', month => partStartWithZero(month + 1, RegExp.$1.length)));
- map.set(/(D+)/i, () => getDateValue('Date', date => partStartWithZero(date, RegExp.$1.length)));
- map.set(/(H+)/i, () => getDateValue('Hours', hour => partStartWithZero(hour, RegExp.$1.length)));
- map.set(/(m+)/, () => getDateValue('Minutes', minute => partStartWithZero(minute, RegExp.$1.length)));
- map.set(/(s+)/, () => getDateValue('Seconds', second => partStartWithZero(second, RegExp.$1.length)));
-
- for (const [reg, fn] of map) {
- if (reg.test(formatStr)) {
- formatStr = formatStr.replace(RegExp.$1, fn.call(null));
- }
- }
-
- return formatStr;
-}
-
-module.exports.iso2utc = function (string) {
- let regexp = "([0-9]{4})(-([0-9]{2})(-([0-9]{2})(T([0-9]{2}):([0-9]{2})(:([0-9]{2})(\.([0-9]+))?)?(Z|(([-+])([0-9]{2}):([0-9]{2})))?)?)?)?";
- if (string) {
- let d = string.match(new RegExp(regexp));
- let offset = 0;
- let date = new Date(d[1], 0, 1);
-
- if (d[3]) {
- date.setMonth(d[3] - 1);
- }
- if (d[5]) {
- date.setDate(+d[5]);
- }
- if (d[7]) {
- date.setHours(d[7]);
- }
- if (d[8]) {
- date.setMinutes(d[8]);
- }
- if (d[10]) {
- date.setSeconds(d[10]);
- }
- if (d[12]) {
- date.setMilliseconds(Number("0." + d[12]) * 1000);
- }
- if (d[14]) {
- offset = (Number(d[16]) * 60) + Number(d[17]);
- offset *= ((d[15] == '-') ? 1 : -1);
- }
-
- offset -= date.getTimezoneOffset();
-
- return (Number(date) + (offset * 60 * 1000));
- } else {
- return string;
- }
-}
diff --git a/packages/dialog/README.md b/packages/dialog/README.md
deleted file mode 100644
index c405d6ab..00000000
--- a/packages/dialog/README.md
+++ /dev/null
@@ -1,138 +0,0 @@
-## Dialog 弹出框
-
-### 使用指南
-在 index.json 中引入组件
-```json
-{
- "usingComponents": {
- "van-dialog": "path/to/vant-weapp/dist/dialog/index"
- }
-}
-```
-
-在需要使用的页面里引入组件库模板和脚本
-```html
-
-```
-```js
-const Dialog = require('path/to/vant-weapp/dist/dialog/dialog');
-
-Page({
- // ...
- // 可以在任意方法里直接调用,即可唤起
- handleClick() {
- Dialog({
- title: '',
- message: '',
- selector: '#van-dialog-test'
- }).then((res) => {
- console.log(res);
- })
- }
-});
-```
-
-### 代码演示
-
-#### 按钮展示方式
-按钮可以通过设置 buttonsShowVertical 来切换按钮纵向展示或者横向并排展示,方便各种场景下使用。
-```js
-Dialog({
- message: '这是一个模态弹窗',
- buttonsShowVertical: true,
- showCancelButton: true
-});
-```
-
-#### 自定义展示按钮
-`dialog` 支持自定义展示按钮。设置 buttons 数组即可实现。自定义按钮的点击后,都会在 resolve 状态中监听到。
-```js
-Dialog({
- message: '这是一个模态弹窗',
- buttons: [{
- // 按钮文案
- text: '现金支付',
- // 按钮文字颜色
- color: 'red',
- // 按钮类型,用于在 then 中接受点击事件时,判断是哪一个按钮被点击
- type: 'cash'
- }, {
- text: '微信支付',
- color: '#3CC51F',
- type: 'wechat'
- }, {
- text: '取消',
- type: 'cancel'
- }]
-}).then(({ type, hasOpenDataPromise, openDataPromise }) => {
- // type 可以用于判断具体是哪一个按钮被点击
- console.log('=== dialog with custom buttons ===', `type: ${type}`);
-
- // - 在使用自定义按钮的情况下,可以将按钮的 openType 设置为微信原生按钮支持的 open-type
- // - 如果设置的 openType 为 'getUserInfo', 'getPhoneNumber', 'openSetting' 其中之一
- // 就认为是需要返回相应的数据
- // 为了处理方便,增加 flag 值 hasOpenDataPromise,表示是否有微信开放数据返回
- // 这时,通过利用 openDataPromise,可以获取开放数据返回的具体信息
- if (hasOpenDataPromise) {
- openDataPromise.then((data) => {
- console.log('成功获取信息', data);
- }).catch((data) => {
- console.log('获取信息失败', data);
- });
- }
-});
-```
-
-#### 方法
-| 方法名 | 参数 | 返回值 | 介绍 |
-|-----------|-----------|-----------|-------------|
-| Dialog | `options` 弹窗展示参数,具体见下方具体参数, `pageCtx` 页面上下文,可以不传,默认使用当前页面 | - | 展示弹窗 |
-| Dialog.close | `options` 和弹窗展示参数一致,这里只需要 selector | - | 关闭弹窗 |
-
-
-### 具体参数
-| 参数 | 说明 | 类型 | 默认值 | 必须 |
-|-----------|-----------|-----------|-------------|-------------|
-| message | 弹窗内容 | String | - | 必须 |
-| selector | 显示弹窗对应组件节点的选择器 | String | - | 必须 |
-| title | 弹窗标题 | String | - | |
-| autoClose | 点击按钮后是否自动关闭弹窗 | Boolean | true | |
-| buttonsShowVertical | 按钮是否纵向展示 | Boolean | false | |
-| showConfirmButton | 是否展示确认按钮 | Boolean | true | |
-| confirmButtonText | 确认按钮文案 | String | 确定 | |
-| confirmButtonColor | 确认按钮文字颜色 | String | #3CC51F | |
-| showCancelButton | 是否展示取消按钮 | Boolean | false | |
-| cancelButtonText | 取消按钮文案 | String | 取消 | |
-| cancelButtonColor | 取消按钮文字颜色 | String | #333 | |
-| buttons | 自定义按钮列表,设置以后,以上关于 确认 和 取消 按钮的设置全部不生效。| Array | - | |
-
-buttons 数据格式
-```js
-[{
- // 按钮文案
- text: '现金支付',
- // 按钮文字颜色
- color: 'red',
- // 按钮类型,用于在 then 中接受点击事件时,判断是哪一个按钮被点击
- type: 'cash'
-}, {
- // 按钮文案
- text: '微信支付',
- // 按钮文字颜色
- color: '#3CC51F',
- // 按钮类型,用于在 then 中接受点击事件时,判断是哪一个按钮被点击
- type: 'wechat'
-}, {
- // 按钮文案
- text: '取消',
- // 按钮类型,用于在 then 中接受点击事件时,判断是哪一个按钮被点击
- type: 'cancel'
-}, {
- text: '获取用户信息',
- type: 'userInfo',
- // 利用 OpenType 设置微信按钮的开放能力
- // 设置对应的值以后,这个按钮就会具有调用微信原生按钮支持的开放能力
- openType: 'getUserInfo'
-}]
-```
-
diff --git a/packages/dialog/data.js b/packages/dialog/data.js
deleted file mode 100644
index 14f9f44d..00000000
--- a/packages/dialog/data.js
+++ /dev/null
@@ -1,24 +0,0 @@
-module.exports = {
- // 标题
- title: '',
- // 内容
- message: ' ',
- // 选择节点
- selector: '#van-dialog',
- // 按钮是否展示为纵向
- buttonsShowVertical: false,
- // 是否展示确定
- showConfirmButton: true,
- // 确认按钮文案
- confirmButtonText: '确定',
- // 确认按钮颜色
- confirmButtonColor: '#3CC51F',
- // 是否展示取消
- showCancelButton: false,
- // 取消按钮文案
- cancelButtonText: '取消',
- // 取消按钮颜色
- cancelButtonColor: '#333',
- // 点击按钮自动关闭 dialog
- autoClose: true
-};
diff --git a/packages/dialog/dialog.js b/packages/dialog/dialog.js
deleted file mode 100644
index b0a50ff8..00000000
--- a/packages/dialog/dialog.js
+++ /dev/null
@@ -1,98 +0,0 @@
-const defaultData = require('./data');
-
-function getDialogCtx({ selector, pageCtx }) {
- let ctx = pageCtx;
- if (!ctx) {
- const pages = getCurrentPages();
- ctx = pages[pages.length - 1];
- }
- return ctx.selectComponent(selector);
-}
-
-function getParsedOptions(options = {}) {
- return {
- // 自定义 button 列表
- // { type: 按钮类型,回调时以此作为区分依据,text: 按钮文案, color: 按钮文字颜色 }
- buttons: [],
- ...defaultData,
- ...options
- };
-}
-
-// options 使用参数
-// pageCtx 页面 page 上下文
-function Dialog(options, pageCtx) {
- const parsedOptions = getParsedOptions(options);
-
- const dialogCtx = getDialogCtx({
- selector: parsedOptions.selector,
- pageCtx
- });
-
- if (!dialogCtx) {
- console.error('无法找到对应的dialog组件,请于页面中注册并在 wxml 中声明 dialog 自定义组件');
- return Promise.reject({ type: 'component error' });
- }
-
- // 处理默认按钮的展示
- // 纵向排布确认按钮在上方
- const { buttons = [] } = parsedOptions;
- let showCustomBtns = false;
- if (buttons.length === 0) {
- if (parsedOptions.showConfirmButton) {
- buttons.push({
- type: 'confirm',
- text: parsedOptions.confirmButtonText,
- color: parsedOptions.confirmButtonColor
- });
- }
-
- if (parsedOptions.showCancelButton) {
- const cancelButton = {
- type: 'cancel',
- text: parsedOptions.cancelButtonText,
- color: parsedOptions.cancelButtonColor
- };
- if (parsedOptions.buttonsShowVertical) {
- buttons.push(cancelButton);
- } else {
- buttons.unshift(cancelButton);
- }
- }
- } else {
- showCustomBtns = true;
- }
-
- return new Promise((resolve, reject) => {
- dialogCtx.setData({
- ...parsedOptions,
- buttons,
- showCustomBtns,
- key: `${(new Date()).getTime()}`,
- show: true,
- promiseFunc: { resolve, reject },
- openTypePromiseFunc: null
- });
- });
-}
-
-Dialog.close = function (options, pageCtx) {
- const parsedOptions = getParsedOptions(options);
-
- const dialogCtx = getDialogCtx({
- selector: parsedOptions.selector,
- pageCtx
- });
-
- if (!dialogCtx) {
- return;
- }
-
- dialogCtx.setData({
- show: false,
- promiseFunc: null,
- openTypePromiseFunc: null
- });
-};
-
-module.exports = Dialog;
diff --git a/packages/dialog/index.js b/packages/dialog/index.js
deleted file mode 100644
index 3a13b929..00000000
--- a/packages/dialog/index.js
+++ /dev/null
@@ -1,111 +0,0 @@
-const _f = function () {};
-const needResponseOpenTypes = ['getUserInfo', 'getPhoneNumber', 'openSetting'];
-
-Component({
- properties: {},
-
- data: {
- // 标题
- title: '',
- // 自定义 button 列表
- // { type: 按钮类型,回调时以此作为区分依据,text: 按钮文案, color: 按钮文字颜色, openType: 微信开放能力 }
- buttons: [],
- // 内容
- message: ' ',
- // 选择节点
- selector: '#van-dialog',
- // 按钮是否展示为纵向
- buttonsShowVertical: false,
- // 是否展示确定
- showConfirmButton: true,
- // 确认按钮文案
- confirmButtonText: '确定',
- // 确认按钮颜色
- confirmButtonColor: '#3CC51F',
- // 是否展示取消
- showCancelButton: false,
- // 取消按钮文案
- cancelButtonText: '取消',
- // 取消按钮颜色
- cancelButtonColor: '#333',
- key: '',
- autoClose: true,
- show: false,
- showCustomBtns: false,
- promiseFunc: {},
- openTypePromiseFunc: {}
- },
-
- methods: {
- handleButtonClick(e) {
- const { currentTarget = {} } = e;
- const { dataset = {} } = currentTarget;
-
- // 获取当次弹出框的信息
- const { resolve = _f, reject = _f } = this.data.promiseFunc || {};
-
- // 重置展示
- if (this.data.autoClose) {
- this.setData({ show: false });
- }
-
- // 自定义按钮,全部 resolve 形式返回,根据 type 区分点击按钮
- if (this.data.showCustomBtns) {
- const isNeedOpenDataButton = needResponseOpenTypes.indexOf(dataset.openType) > -1;
- const resolveData = { type: dataset.type };
- // 如果需要 openData,就额外返回一个 promise,用于后续 open 数据返回
- if (isNeedOpenDataButton) {
- resolveData.openDataPromise = new Promise((resolve, reject) => {
- this.setData({ openTypePromiseFunc: { resolve, reject } });
- });
- resolveData.hasOpenDataPromise = true;
- }
- resolve(resolveData);
- return;
- }
-
- // 默认按钮,确认为 resolve,取消为 reject
- if (dataset.type === 'confirm') {
- resolve({
- type: 'confirm'
- });
- } else {
- reject({
- type: 'cancel'
- });
- }
-
- this.setData({ promiseFunc: {} });
- },
-
- // 以下为处理微信按钮开放能力的逻辑
- handleUserInfoResponse({ detail }) {
- this.__handleOpenDataResponse({
- type: detail.errMsg === 'getUserInfo:ok' ? 'resolve' : 'reject',
- data: detail
- });
- },
-
- handlePhoneResponse({ detail }) {
- this.__handleOpenDataResponse({
- type: detail.errMsg === 'getPhoneNumber:ok' ? 'resolve' : 'reject',
- data: detail
- });
- },
-
- handleOpenSettingResponse({ detail }) {
- this.__handleOpenDataResponse({
- type: detail.errMsg === 'openSetting:ok' ? 'resolve' : 'reject',
- data: detail
- });
- },
-
- __handleOpenDataResponse({ type = 'resolve', data = {} }) {
- const promiseFuncs = this.data.openTypePromiseFunc || {};
- const responseFunc = promiseFuncs[type] || _f;
-
- responseFunc(data);
- this.setData({ openTypePromiseFunc: null });
- }
- }
-});
diff --git a/packages/dialog/index.json b/packages/dialog/index.json
deleted file mode 100644
index 4c9bf594..00000000
--- a/packages/dialog/index.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "component": true,
- "usingComponents": {
- "pop-manager": "../common/pop-manager/index",
- "van-button": "../button/index"
- }
-}
diff --git a/packages/dialog/index.pcss b/packages/dialog/index.pcss
deleted file mode 100644
index 5e350e5a..00000000
--- a/packages/dialog/index.pcss
+++ /dev/null
@@ -1,68 +0,0 @@
-/* 基础样式 */
-.van-dialog--container {
- width: 80vw;
- font-size: 16px;
- overflow: hidden;
- border-radius: 4px;
- background-color: #fff;
- color: #333;
-}
-
-/* 弹出层内容 */
-.van-dialog__header {
- padding: 15px 0 0;
- text-align: center;
-}
-
-.van-dialog__content {
- position: relative;
- padding: 15px 20px;
- line-height: 1.5;
- min-height: 40px;
-
- &::after {
- border-bottom-width: 1px;
- }
-}
-
-/* 在有标题时,需要减弱内容的存在感 */
-.van-dialog__content--title {
- color: #999;
- font-size: 14px;
-}
-
-.van-dialog__footer {
- overflow: hidden;
-}
-
-.van-dialog__button {
- flex: 1;
-}
-
-.van-dialog__button-inside, .van-dialog__button-inside--first {
- margin-bottom: 0;
- line-height: 50px;
- height: 50px;
-
- &::after {
- border-width: 0;
- border-radius: 0;
- }
-}
-
-/* 水平/垂直布局 */
-.van-dialog__footer--horizon {
- display: flex;
-}
-
-.van-dialog__footer--horizon .van-dialog__button-inside {
- &::after {
- border-left-width: 1px;
- }
-}
-
-.van-dialog__footer--vertical .van-dialog__button-inside {
- &::after {
- border-top-width: 1px;
- }
-}
diff --git a/packages/dialog/index.wxml b/packages/dialog/index.wxml
deleted file mode 100644
index a61145c1..00000000
--- a/packages/dialog/index.wxml
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-
-
- {{ message }}
-
-
-
-
diff --git a/packages/index.js b/packages/index.js
index 9cfab64c..e69de29b 100644
--- a/packages/index.js
+++ b/packages/index.js
@@ -1,4 +0,0 @@
-exports.Dialog = require('./dialog/dialog');
-exports.Toast = require('./toast/toast');
-exports.TopTips = require('./toptips/toptips');
-
diff --git a/packages/radio/README.md b/packages/radio/README.md
deleted file mode 100644
index 85916934..00000000
--- a/packages/radio/README.md
+++ /dev/null
@@ -1,106 +0,0 @@
-## Radio 单选框
-
-### 使用指南
-在 index.json 中引入组件
-```json
-{
- "usingComponents": {
- "van-radio": "/packages/radio/index"
- }
-}
-```
-
-### 代码演示
-
-#### 基础数据结构
-
-```js
-items: [
- {name: 'USA', value: '美国'},
- {name: 'BRA', value: '巴西', disabled: true },
- {name: 'CHN', value: '中国', checked: 'true'}
-]
-```
-
-#### 基础用法
-
-```html
-
-```
-
-#### 禁用状态
-
-```html
-
-```
-
-```js
-Page({
- data: {
- items: [
- {name: 'USA', value: '美国'},
- {name: 'BRA', value: '巴西', disabled: true },
- {name: 'CHN', value: '中国', checked: 'true'}
- ]
- }
-})
-```
-
-#### 自定义样式
-
-```html
-
-```
-
-```css
-.radio-demo {
- font-size: 12px !important;
-}
-
-.radio-color {
- color: red !important;
-}
-```
-
-#### 事件
-
-```html
-
-
-
-```
-
-```js
-Page({
- handleRadioChange: function(e) {
- console.log('radio发生change事件,携带value值为:', e.detail)
- }
-})
-```
-
-#### 列表模式
-
-```html
-
-```
-
-### 参数
-| 参数 | 说明 | 类型 | 默认值 | 必须 |
-|-----------|-----------|-----------|-------------|-------------|
-| items | 单选数组 | Array | [] | - |
-| type | 显示类型: list | String | - | |
-| radio-class | radio样式类| String| -|
-| radio-color | radio选中颜色 | String | #06bf04|
-
-### 事件
-
-| 事件名称 | 说明 | 回调参数 |
-| ---- | --- | ---|
-| change | 数值改变时触发 | event |
diff --git a/packages/radio/index.js b/packages/radio/index.js
deleted file mode 100644
index 3a9be02a..00000000
--- a/packages/radio/index.js
+++ /dev/null
@@ -1,31 +0,0 @@
-Component({
- behaviors: ['wx://form-field'],
-
- externalClasses: ['radio-class', 'radio-color'],
-
- properties: {
- items: Array,
- type: String
- },
-
- methods: {
- radioChange(e) {
- this.selectItem(e.detail.value)
- this.triggerEvent('change', e)
- },
-
- selectItem(value) {
- let { items } = this.data;
-
- items.forEach(item => {
- if ( item.name === value ) {
- item.checked = true;
- } else {
- item.checked = false;
- }
- })
-
- this.setData({ items })
- }
- }
-});
diff --git a/packages/radio/index.json b/packages/radio/index.json
deleted file mode 100644
index 0a336c08..00000000
--- a/packages/radio/index.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "component": true,
- "usingComponents": {
- "van-icon": "../icon/index"
- }
-}
diff --git a/packages/radio/index.pcss b/packages/radio/index.pcss
deleted file mode 100644
index 63eaa08b..00000000
--- a/packages/radio/index.pcss
+++ /dev/null
@@ -1,79 +0,0 @@
-.van-radio {
- display: block;
- padding: 0 10px;
- font-size: 14px;
-
- &__item {
- display: block;
- margin-top: 10px;
- height: 20px;
-
- &:last-child {
- margin-bottom: 10px;
- }
- }
-
- &__list-item {
- display: block;
- padding: 10px 10px 10px 0;
- border-bottom: 1px solid #e5e5e5;
- .van-radio__icon-wrap {
- float: right;
- margin-top: 3px;
- }
- }
-
- &__icon-wrap {
- position: relative;
- width: 14px;
- height: 15px;
- display: inline-flex;
- align-items: center;
- color: #aaa;
- .van-radio__origin {
- opacity: 0;
- width: 14px;
- height: 20px;
- }
- .van-radio__icon {
- position: absolute;
- left: 50%;
- top: 50%;
- transform: translate(-50%,-50%);
- border: 1px solid #dcdfe6;
- border-radius: 100%;
- width: 14px;
- height: 14px;
- background-color: #fff;
- cursor: pointer;
- box-sizing: border-box;
-
- .van-radio__icon-inside {
- position: absolute;
- left: 50%;
- top: 50%;
- transform: translate(-50%,-50%);
- width: 4px;
- height: 4px;
- border-radius: 50%;
- }
-
- &.van-radio--checked {
- border-color: #06bf04;
- background: #06bf04;
- .van-radio__icon-inside {
- background-color: #fff;
- }
- }
-
- &.van-radio--disabled {
- opacity: .6;
- }
- }
- }
-
- &__name {
- display: inline-block;
- margin-left: 10px;
- }
-}
diff --git a/packages/radio/index.wxml b/packages/radio/index.wxml
deleted file mode 100644
index 961b8c1a..00000000
--- a/packages/radio/index.wxml
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
-
diff --git a/packages/tab/README.md b/packages/tab/README.md
deleted file mode 100644
index 515728ba..00000000
--- a/packages/tab/README.md
+++ /dev/null
@@ -1,79 +0,0 @@
-## Tab 标签
-
-### 使用指南
-在 index.json 中引入组件
-```json
-{
- "usingComponents": {
- "van-tab": "path/to/vant-weapp/dist/tab/index"
- }
-}
-```
-
-在 index.js 中声明组件数据
-```js
-// 在 Page 中声明 Tab 依赖的展示数据
-Page({
- data: {
- list: [{
- id: 'xxx',
- title: 'xxx'
- }],
- selectedId: 'xxx',
- ...
- }
-})
-```
-
-### 代码演示
-可以在任意位置上使用 van-tab 标签。传入对应的数据即可。
-```html
-
-```
-
-| 参数 | 说明 | 类型 | 默认值 | 必须 |
-|-----------|-----------|-----------|-------------|-------------|
-| scroll | 是否开启 tab 左右滑动模式 | Boolean | - | |
-| list | 可选项列表 | Array | - | |
-| selectedId | 选中id | - | - | |
-| height | tab高度 | Number | - | |
-| fixed | 是否固定位置 | Boolean | - | |
-
-
-tab 组件中,list 数据格式如下
-```js
-[{
- // tab 项 id
- id: 'all',
- // tab 项展示文案
- title: '全部'
-}, {
- id: 'topay',
- title: '待付款'
-}, {
- id: 'tosend',
- title: '待发货'
-}, {
- id: 'send',
- title: '待收货'
-}, {
- id: 'sign',
- title: '已完成'
-}]
-```
-
-可以监听 bindtabchange 事件回调,在页面注册回调函数
-```js
-Page({
- customCallback(selectedId) {
- // selectId 表示被选中 tab 项的 id
- }
-}));
-```
diff --git a/packages/tab/index.js b/packages/tab/index.js
deleted file mode 100644
index ed1559ca..00000000
--- a/packages/tab/index.js
+++ /dev/null
@@ -1,58 +0,0 @@
-Component({
- externalClasses: 'class',
-
- properties: {
- scroll: {
- type: Boolean,
- value: false
- },
- fixed: {
- type: Boolean,
- value: false
- },
- height: {
- type: Number,
- value: 0
- },
- list: {
- type: Array,
- value: []
- },
- selectedId: {
- type: [String, Number],
- value: ''
- }
- },
-
- data: {
- scrollLeft: 0
- },
-
- methods: {
- _handleScroll(selectedId) {
- const query = wx.createSelectorQuery().in(this);
- query.select(`#item-${selectedId}`).boundingClientRect();
- query.select('#scroll-view').boundingClientRect();
- query.select('#scroll-view').scrollOffset();
- query.exec(res => {
- this.setData({
- scrollLeft: res[2].scrollLeft + res[0].left + res[0].width / 2 - res[1].width / 2
- });
- });
- },
- _handleZanTabChange(e) {
- const selectedId = e.currentTarget.dataset.itemId;
-
- if (this.data.scroll) {
- this._handleScroll(selectedId);
- }
-
- this.setData({
- selectedId
- });
-
- console.info('[zan:tab:change] selectedId:', selectedId);
- this.triggerEvent('tabchange', selectedId);
- }
- }
-});
diff --git a/packages/tab/index.json b/packages/tab/index.json
deleted file mode 100644
index 32640e0d..00000000
--- a/packages/tab/index.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "component": true
-}
\ No newline at end of file
diff --git a/packages/tab/index.pcss b/packages/tab/index.pcss
deleted file mode 100644
index 75cea43b..00000000
--- a/packages/tab/index.pcss
+++ /dev/null
@@ -1,50 +0,0 @@
-.van-tab {
- height: 45px;
-}
-.van-tab__bd {
- width: 100%;
- display: flex;
- flex-direction: row;
- border-bottom: 1rpx solid #e5e5e5;
- background: #fff;
-}
-.van-tab__bd--fixed {
- position: fixed;
- top: 0;
- z-index: 2;
-}
-.van-tab__item {
- flex: 1;
- display: inline-block;
- padding: 0 5px;
- line-height: 0;
- box-sizing: border-box;
- overflow: hidden;
- text-align: center;
-}
-
-.van-tab__title {
- display: inline-block;
- max-width: 100%;
- height: 44px;
- line-height: 44px;
- overflow: hidden;
- text-overflow: ellipsis;
- box-sizing: border-box;
- word-break: keep-all;
- font-size: 14px;
- color: #666;
-}
-
-.van-tab__item--selected .van-tab__title {
- color: #f44;
- border-bottom: 2px solid #f44;
-}
-
-.van-tab__bd--scroll {
- display: block;
- white-space: nowrap;
-}
-.van-tab__bd--scroll .van-tab__item {
- min-width: 80px;
-}
diff --git a/packages/tab/index.wxml b/packages/tab/index.wxml
deleted file mode 100644
index 409e2670..00000000
--- a/packages/tab/index.wxml
+++ /dev/null
@@ -1,51 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ item.title }}
-
-
-
diff --git a/packages/toptips/README.md b/packages/toptips/README.md
deleted file mode 100644
index b4a04c6e..00000000
--- a/packages/toptips/README.md
+++ /dev/null
@@ -1,128 +0,0 @@
-## TopTips 顶部提示
-
-### 使用指南
-在 index.json 中引入组件
-```json
-{
- "usingComponents": {
- "van-toptips": "path/to/vant-weapp/dist/toptips/index"
- }
-}
-```
-
-在 index.js 中声明组件数据
-
-**toptips提供了声明式和命令式2种调用方式,但是由于小程序本身限制,会有一定使用的要求**
-```js
-// 使用声明式调用的方式, 必须在Page中声明 $vant对象, 结构如下
-// 同时在其他触发toptips显示的函数中,需要手动改变对应的数值
-Page({
- data: {
- duration: 1000,
- content: 'xxx',
- $vant: {
- toptips: {
- show: false
- }
- }
- }
-})
-
-// 使用命令式调用的方式,必须在 wxml 模板中声明组件id,
-// 默认我们使用了 van-toptips, 如果使用者要更换,可以手动传入
-// 注意和 usingComponents 里引用的路径不一样
-const Toptips = require('path/to/vant-weapp/dist/toptips/toptips');
-Page({
- customCallback() {
- Toptips('只传文案展示');
- }
-})
-
-```
-
-### 代码演示
-
-### 声明式调用
-使用声明式调用
-```js
-Page({
- data: {
- duration: 1000,
- content: 'xxx',
- $vant: {
- toptips: {
- show: false
- }
- }
- },
-
- customCallback() {
- this.setData({
- $vant: {
- toptips: {
- show: true
- }
- }
- });
-
- setTimeout(() => {
- this.setData({
- $vant: {
- toptips: {
- show: false
- }
- }
- })
- }, this.data.duration);
- }
-})
-```
-```html
-
-```
-
-### 命令式调用
-```js
-Page({
- customCallback() {
- Toptips('我只改文案')
- }
-})
-```
-```html
-
-```
-
-### 修改组件id
-```js
-Page({
- customCallback() {
- Toptips({
- content: '传入其他参数',
- selector: '#other-id',
- duration: 5000
- })
- }
-})
-```
-```html
-
-```
-
-| 参数 | 说明 | 类型 | 默认值 | 可选值 |
-|-----------|-----------|-----------|-------------|-------------|
-| content | 展示文案 | String | - | |
-| duration | 弹层持续时间 | Number | 3000 | |
-| isShow | 弹层是否展示 | Boolean | false | |
-| color | 字体颜色 | String | `#fff` | |
-| backgroundColor | 提示背景色 | String | `#e64340` |
\ No newline at end of file
diff --git a/packages/toptips/index.js b/packages/toptips/index.js
deleted file mode 100644
index 41e47c99..00000000
--- a/packages/toptips/index.js
+++ /dev/null
@@ -1,50 +0,0 @@
-const FONT_COLOR = '#fff';
-const BG_COLOR = '#e64340';
-
-Component({
- properties: {
- content: String,
- color: {
- type: String,
- value: FONT_COLOR
- },
- backgroundColor: {
- type: String,
- value: BG_COLOR
- },
- isShow: {
- type: Boolean,
- value: false
- },
- duration: {
- type: Number,
- value: 3000
- }
- },
-
- methods: {
- show() {
- const { duration } = this.data;
-
- this._timer && clearTimeout(this._timer);
- this.setData({
- isShow: true
- });
-
- if (duration > 0 && duration !== Infinity) {
- this._timer = setTimeout(() => {
- this.hide();
- }, duration);
- }
- },
-
- hide() {
- this._timer = clearTimeout(this._timer);
-
- this.setData({
- isShow: false,
- backgroundColor: BG_COLOR
- });
- }
- }
-});
diff --git a/packages/toptips/index.json b/packages/toptips/index.json
deleted file mode 100644
index 32640e0d..00000000
--- a/packages/toptips/index.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "component": true
-}
\ No newline at end of file
diff --git a/packages/toptips/index.pcss b/packages/toptips/index.pcss
deleted file mode 100644
index 5e8f5525..00000000
--- a/packages/toptips/index.pcss
+++ /dev/null
@@ -1,24 +0,0 @@
-.van-toptips {
- display: block;
- position: fixed;
- -webkit-transform: translateZ(0) translateY(-100%);
- width: 100%;
- /* 至少有一行的高度,保证第一次动画显示正常 */
- min-height: 32px;
- top: 0;
- line-height: 2.3;
- font-size: 14px;
- text-align: center;
- color: #FFF;
- background-color: #E64340;
- z-index: 110;
- opacity: 0;
-
- /* 动画部分 */
- transition: all 0.4s ease;
-}
-
-.van-toptips--show {
- -webkit-transform: translateZ(0) translateY(0);
- opacity: 1;
-}
diff --git a/packages/toptips/index.wxml b/packages/toptips/index.wxml
deleted file mode 100644
index 9f42050c..00000000
--- a/packages/toptips/index.wxml
+++ /dev/null
@@ -1 +0,0 @@
-{{ content }}
diff --git a/packages/toptips/toptips.js b/packages/toptips/toptips.js
deleted file mode 100644
index 0fa81c78..00000000
--- a/packages/toptips/toptips.js
+++ /dev/null
@@ -1,25 +0,0 @@
-
-function Toptips(options = {}) {
- const pages = getCurrentPages();
- const ctx = pages[pages.length - 1];
- const defaultOptions = {
- selector: '#van-toptips',
- duration: 3000
- };
-
- options = Object.assign(defaultOptions, parseParam(options));
-
- const $toptips = ctx.selectComponent(options.selector);
- delete options.selector;
-
- $toptips.setData({
- ...options
- });
- $toptips && $toptips.show();
-}
-
-function parseParam(params = '') {
- return typeof params === 'object' ? params : { content: params };
-}
-
-module.exports = Toptips;
\ No newline at end of file