vant 2.12.30-beta.0 → 2.12.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -12
- package/README.zh-CN.md +13 -11
- package/es/field/index.js +9 -4
- package/es/index.js +1 -1
- package/es/notice-bar/index.js +28 -30
- package/es/picker/PickerColumn.js +63 -14
- package/es/progress/index.js +5 -0
- package/es/sku/index.css +1 -1
- package/es/sku/index.less +4 -0
- package/es/switch/index.css +1 -1
- package/es/switch/index.less +2 -0
- package/es/tabbar/index.js +12 -12
- package/es/tabbar-item/index.js +17 -8
- package/lib/field/index.js +9 -4
- package/lib/index.css +1 -1
- package/lib/index.js +1 -1
- package/lib/notice-bar/index.js +28 -30
- package/lib/picker/PickerColumn.js +64 -12
- package/lib/progress/index.js +6 -0
- package/lib/sku/index.css +1 -1
- package/lib/sku/index.less +4 -0
- package/lib/switch/index.css +1 -1
- package/lib/switch/index.less +2 -0
- package/lib/tabbar/index.js +13 -13
- package/lib/tabbar-item/index.js +17 -8
- package/lib/vant.js +136 -70
- package/lib/vant.min.js +1 -1
- package/package.json +1 -1
- package/vetur/attributes.json +187 -187
- package/vetur/tags.json +68 -68
- package/vetur/web-types.json +613 -613
- package/changelog.generated.md +0 -16
package/lib/index.js
CHANGED
@@ -361,7 +361,7 @@ exports.TreeSelect = _treeSelect.default;
|
|
361
361
|
var _uploader = _interopRequireDefault(require("./uploader"));
|
362
362
|
|
363
363
|
exports.Uploader = _uploader.default;
|
364
|
-
var version = '2.12.
|
364
|
+
var version = '2.12.32';
|
365
365
|
exports.version = version;
|
366
366
|
|
367
367
|
function install(Vue) {
|
package/lib/notice-bar/index.js
CHANGED
@@ -21,7 +21,7 @@ var _default = createComponent({
|
|
21
21
|
mixins: [(0, _bindEvent.BindEventMixin)(function (bind) {
|
22
22
|
// fix cache issues with forwards and back history in safari
|
23
23
|
// see: https://guwii.com/cache-issues-with-forwards-and-back-history-in-safari/
|
24
|
-
bind(window, 'pageshow', this.
|
24
|
+
bind(window, 'pageshow', this.reset);
|
25
25
|
})],
|
26
26
|
inject: {
|
27
27
|
vanPopup: {
|
@@ -58,24 +58,20 @@ var _default = createComponent({
|
|
58
58
|
};
|
59
59
|
},
|
60
60
|
watch: {
|
61
|
-
scrollable: '
|
61
|
+
scrollable: 'reset',
|
62
62
|
text: {
|
63
|
-
handler: '
|
63
|
+
handler: 'reset',
|
64
64
|
immediate: true
|
65
65
|
}
|
66
66
|
},
|
67
67
|
created: function created() {
|
68
|
-
var _this = this;
|
69
|
-
|
70
68
|
// https://github.com/youzan/vant/issues/8634
|
71
69
|
if (this.vanPopup) {
|
72
|
-
this.vanPopup.onReopen(
|
73
|
-
_this.start();
|
74
|
-
});
|
70
|
+
this.vanPopup.onReopen(this.reset);
|
75
71
|
}
|
76
72
|
},
|
77
73
|
activated: function activated() {
|
78
|
-
this.
|
74
|
+
this.reset();
|
79
75
|
},
|
80
76
|
methods: {
|
81
77
|
onClickIcon: function onClickIcon(event) {
|
@@ -85,7 +81,7 @@ var _default = createComponent({
|
|
85
81
|
}
|
86
82
|
},
|
87
83
|
onTransitionEnd: function onTransitionEnd() {
|
88
|
-
var
|
84
|
+
var _this = this;
|
89
85
|
|
90
86
|
this.offset = this.wrapWidth;
|
91
87
|
this.duration = 0; // wait for Vue to render offset
|
@@ -94,50 +90,52 @@ var _default = createComponent({
|
|
94
90
|
(0, _raf.raf)(function () {
|
95
91
|
// use double raf to ensure animation can start
|
96
92
|
(0, _raf.doubleRaf)(function () {
|
97
|
-
|
98
|
-
|
93
|
+
_this.offset = -_this.contentWidth;
|
94
|
+
_this.duration = (_this.contentWidth + _this.wrapWidth) / _this.speed;
|
99
95
|
|
100
|
-
|
96
|
+
_this.$emit('replay');
|
101
97
|
});
|
102
98
|
});
|
103
99
|
},
|
100
|
+
// not an exposed-api, but may used by some users
|
101
|
+
start: function start() {
|
102
|
+
this.reset();
|
103
|
+
},
|
104
|
+
// @exposed-api
|
104
105
|
reset: function reset() {
|
106
|
+
var _this2 = this;
|
107
|
+
|
108
|
+
var delay = (0, _utils.isDef)(this.delay) ? this.delay * 1000 : 0;
|
105
109
|
this.offset = 0;
|
106
110
|
this.duration = 0;
|
107
111
|
this.wrapWidth = 0;
|
108
112
|
this.contentWidth = 0;
|
109
|
-
},
|
110
|
-
start: function start() {
|
111
|
-
var _this3 = this;
|
112
|
-
|
113
|
-
var delay = (0, _utils.isDef)(this.delay) ? this.delay * 1000 : 0;
|
114
|
-
this.reset();
|
115
113
|
clearTimeout(this.startTimer);
|
116
114
|
this.startTimer = setTimeout(function () {
|
117
|
-
var
|
118
|
-
wrap =
|
119
|
-
content =
|
115
|
+
var _this2$$refs = _this2.$refs,
|
116
|
+
wrap = _this2$$refs.wrap,
|
117
|
+
content = _this2$$refs.content;
|
120
118
|
|
121
|
-
if (!wrap || !content ||
|
119
|
+
if (!wrap || !content || _this2.scrollable === false) {
|
122
120
|
return;
|
123
121
|
}
|
124
122
|
|
125
123
|
var wrapWidth = wrap.getBoundingClientRect().width;
|
126
124
|
var contentWidth = content.getBoundingClientRect().width;
|
127
125
|
|
128
|
-
if (
|
126
|
+
if (_this2.scrollable || contentWidth > wrapWidth) {
|
129
127
|
(0, _raf.doubleRaf)(function () {
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
128
|
+
_this2.offset = -contentWidth;
|
129
|
+
_this2.duration = contentWidth / _this2.speed;
|
130
|
+
_this2.wrapWidth = wrapWidth;
|
131
|
+
_this2.contentWidth = contentWidth;
|
134
132
|
});
|
135
133
|
}
|
136
134
|
}, delay);
|
137
135
|
}
|
138
136
|
},
|
139
137
|
render: function render() {
|
140
|
-
var
|
138
|
+
var _this3 = this;
|
141
139
|
|
142
140
|
var h = arguments[0];
|
143
141
|
var slots = this.slots,
|
@@ -212,7 +210,7 @@ var _default = createComponent({
|
|
212
210
|
"style": barStyle,
|
213
211
|
"on": {
|
214
212
|
"click": function click(event) {
|
215
|
-
|
213
|
+
_this3.$emit('click', event);
|
216
214
|
}
|
217
215
|
}
|
218
216
|
}, [LeftIcon(), h("div", {
|
@@ -3,7 +3,7 @@
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
4
|
|
5
5
|
exports.__esModule = true;
|
6
|
-
exports.default = void 0;
|
6
|
+
exports.default = exports.MOMENTUM_LIMIT_DISTANCE = exports.MOMENTUM_LIMIT_TIME = void 0;
|
7
7
|
|
8
8
|
var _babelHelperVueJsxMergeProps = _interopRequireDefault(require("@vue/babel-helper-vue-jsx-merge-props"));
|
9
9
|
|
@@ -22,7 +22,9 @@ var DEFAULT_DURATION = 200; // 惯性滑动思路:
|
|
22
22
|
// 距离大于 `MOMENTUM_LIMIT_DISTANCE` 时,执行惯性滑动
|
23
23
|
|
24
24
|
var MOMENTUM_LIMIT_TIME = 300;
|
25
|
+
exports.MOMENTUM_LIMIT_TIME = MOMENTUM_LIMIT_TIME;
|
25
26
|
var MOMENTUM_LIMIT_DISTANCE = 15;
|
27
|
+
exports.MOMENTUM_LIMIT_DISTANCE = MOMENTUM_LIMIT_DISTANCE;
|
26
28
|
|
27
29
|
var _createNamespace = (0, _utils.createNamespace)('picker-column'),
|
28
30
|
createComponent = _createNamespace[0],
|
@@ -37,7 +39,12 @@ function getElementTranslateY(element) {
|
|
37
39
|
|
38
40
|
function isOptionDisabled(option) {
|
39
41
|
return (0, _utils.isObject)(option) && option.disabled;
|
40
|
-
}
|
42
|
+
} // use standard WheelEvent:
|
43
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/WheelEvent
|
44
|
+
|
45
|
+
|
46
|
+
var supportMousewheel = ('onwheel' in window);
|
47
|
+
var mousewheelTimer = null;
|
41
48
|
|
42
49
|
var _default2 = createComponent({
|
43
50
|
mixins: [_touch.TouchMixin],
|
@@ -74,6 +81,10 @@ var _default2 = createComponent({
|
|
74
81
|
},
|
75
82
|
mounted: function mounted() {
|
76
83
|
this.bindTouchEvent(this.$el);
|
84
|
+
|
85
|
+
if (supportMousewheel) {
|
86
|
+
(0, _event.on)(this.$el, 'wheel', this.onMouseWheel, false);
|
87
|
+
}
|
77
88
|
},
|
78
89
|
destroyed: function destroyed() {
|
79
90
|
var children = this.$parent.children;
|
@@ -81,6 +92,10 @@ var _default2 = createComponent({
|
|
81
92
|
if (children) {
|
82
93
|
children.splice(children.indexOf(this), 1);
|
83
94
|
}
|
95
|
+
|
96
|
+
if (supportMousewheel) {
|
97
|
+
(0, _event.off)(this.$el, 'wheel');
|
98
|
+
}
|
84
99
|
},
|
85
100
|
watch: {
|
86
101
|
initialOptions: 'setOptions',
|
@@ -168,6 +183,43 @@ var _default2 = createComponent({
|
|
168
183
|
_this.moving = false;
|
169
184
|
}, 0);
|
170
185
|
},
|
186
|
+
onMouseWheel: function onMouseWheel(event) {
|
187
|
+
var _this2 = this;
|
188
|
+
|
189
|
+
if (this.readonly) {
|
190
|
+
return;
|
191
|
+
}
|
192
|
+
|
193
|
+
(0, _event.preventDefault)(event, true); // simply combine touchstart and touchmove
|
194
|
+
|
195
|
+
var translateY = getElementTranslateY(this.$refs.wrapper);
|
196
|
+
this.startOffset = Math.min(0, translateY - this.baseOffset);
|
197
|
+
this.momentumOffset = this.startOffset;
|
198
|
+
this.transitionEndTrigger = null; // directly use deltaY, see https://caniuse.com/?search=deltaY
|
199
|
+
// use deltaY to detect direction for not special setting device
|
200
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/Element/wheel_event
|
201
|
+
|
202
|
+
var deltaY = event.deltaY;
|
203
|
+
|
204
|
+
if (this.startOffset === 0 && deltaY < 0) {
|
205
|
+
return;
|
206
|
+
} // get offset
|
207
|
+
// if necessary, can adjust distance value to make scrolling smoother
|
208
|
+
|
209
|
+
|
210
|
+
var distance = -deltaY;
|
211
|
+
this.offset = (0, _number.range)(this.startOffset + distance, -(this.count * this.itemHeight), this.itemHeight);
|
212
|
+
|
213
|
+
if (mousewheelTimer) {
|
214
|
+
clearTimeout(mousewheelTimer);
|
215
|
+
}
|
216
|
+
|
217
|
+
mousewheelTimer = setTimeout(function () {
|
218
|
+
_this2.onTouchEnd();
|
219
|
+
|
220
|
+
_this2.touchStartTime = 0;
|
221
|
+
}, MOMENTUM_LIMIT_TIME);
|
222
|
+
},
|
171
223
|
onTransitionEnd: function onTransitionEnd() {
|
172
224
|
this.stopMomentum();
|
173
225
|
},
|
@@ -199,17 +251,17 @@ var _default2 = createComponent({
|
|
199
251
|
return option;
|
200
252
|
},
|
201
253
|
setIndex: function setIndex(index, emitChange) {
|
202
|
-
var
|
254
|
+
var _this3 = this;
|
203
255
|
|
204
256
|
index = this.adjustIndex(index) || 0;
|
205
257
|
var offset = -index * this.itemHeight;
|
206
258
|
|
207
259
|
var trigger = function trigger() {
|
208
|
-
if (index !==
|
209
|
-
|
260
|
+
if (index !== _this3.currentIndex) {
|
261
|
+
_this3.currentIndex = index;
|
210
262
|
|
211
263
|
if (emitChange) {
|
212
|
-
|
264
|
+
_this3.$emit('change', index);
|
213
265
|
}
|
214
266
|
}
|
215
267
|
}; // trigger the change event after transitionend when moving
|
@@ -255,7 +307,7 @@ var _default2 = createComponent({
|
|
255
307
|
}
|
256
308
|
},
|
257
309
|
genOptions: function genOptions() {
|
258
|
-
var
|
310
|
+
var _this4 = this;
|
259
311
|
|
260
312
|
var h = this.$createElement;
|
261
313
|
var optionStyle = {
|
@@ -264,7 +316,7 @@ var _default2 = createComponent({
|
|
264
316
|
return this.options.map(function (option, index) {
|
265
317
|
var _domProps;
|
266
318
|
|
267
|
-
var text =
|
319
|
+
var text = _this4.getOptionText(option);
|
268
320
|
|
269
321
|
var disabled = isOptionDisabled(option);
|
270
322
|
var data = {
|
@@ -275,19 +327,19 @@ var _default2 = createComponent({
|
|
275
327
|
},
|
276
328
|
class: [bem('item', {
|
277
329
|
disabled: disabled,
|
278
|
-
selected: index ===
|
330
|
+
selected: index === _this4.currentIndex
|
279
331
|
})],
|
280
332
|
on: {
|
281
333
|
click: function click() {
|
282
|
-
|
334
|
+
_this4.onClickItem(index);
|
283
335
|
}
|
284
336
|
}
|
285
337
|
};
|
286
338
|
var childData = {
|
287
339
|
class: 'van-ellipsis',
|
288
|
-
domProps: (_domProps = {}, _domProps[
|
340
|
+
domProps: (_domProps = {}, _domProps[_this4.allowHtml ? 'innerHTML' : 'textContent'] = text, _domProps)
|
289
341
|
};
|
290
|
-
return h("li", (0, _babelHelperVueJsxMergeProps.default)([{}, data]), [
|
342
|
+
return h("li", (0, _babelHelperVueJsxMergeProps.default)([{}, data]), [_this4.slots('option', option) || h("div", (0, _babelHelperVueJsxMergeProps.default)([{}, childData]))]);
|
291
343
|
});
|
292
344
|
}
|
293
345
|
},
|
package/lib/progress/index.js
CHANGED
@@ -5,11 +5,17 @@ exports.default = void 0;
|
|
5
5
|
|
6
6
|
var _utils = require("../utils");
|
7
7
|
|
8
|
+
var _bindEvent = require("../mixins/bind-event");
|
9
|
+
|
8
10
|
var _createNamespace = (0, _utils.createNamespace)('progress'),
|
9
11
|
createComponent = _createNamespace[0],
|
10
12
|
bem = _createNamespace[1];
|
11
13
|
|
12
14
|
var _default = createComponent({
|
15
|
+
mixins: [(0, _bindEvent.BindEventMixin)(function (bind) {
|
16
|
+
bind(window, 'resize', this.resize, true);
|
17
|
+
bind(window, 'orientationchange', this.resize, true);
|
18
|
+
})],
|
13
19
|
props: {
|
14
20
|
color: String,
|
15
21
|
inactive: Boolean,
|
package/lib/sku/index.css
CHANGED
@@ -1 +1 @@
|
|
1
|
-
.van-sku-container{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column;-webkit-box-align:stretch;-webkit-align-items:stretch;align-items:stretch;min-height:50%;max-height:80%;overflow-y:visible;font-size:14px;background:#fff}.van-sku-body{-webkit-box-flex:1;-webkit-flex:1 1 auto;flex:1 1 auto;min-height:44px;overflow-y:scroll;-webkit-overflow-scrolling:touch}.van-sku-body::-webkit-scrollbar{display:none}.van-sku-header{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-flex-shrink:0;flex-shrink:0;margin:0 16px}.van-sku-header__img-wrap{-webkit-flex-shrink:0;flex-shrink:0;width:96px;height:96px;margin:12px 12px 12px 0;overflow:hidden;border-radius:4px}.van-sku-header__goods-info{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column;-webkit-box-pack:end;-webkit-justify-content:flex-end;justify-content:flex-end;padding:12px 20px 12px 0}.van-sku-header-item{margin-top:8px;color:#969799;font-size:12px;line-height:16px}.van-sku__price-symbol{font-size:16px;vertical-align:bottom}.van-sku__price-num{font-weight:500;font-size:22px;vertical-align:bottom;word-wrap:break-word}.van-sku__goods-price{margin-left:-2px;color:#ee0a24}.van-sku__price-tag{position:relative;display:inline-block;margin-left:8px;padding:0 5px;overflow:hidden;color:#ee0a24;font-size:12px;line-height:16px;border-radius:8px}.van-sku__price-tag::before{position:absolute;top:0;left:0;width:100%;height:100%;background:currentColor;opacity:.1;content:''}.van-sku-group-container{padding-top:12px}.van-sku-group-container--hide-soldout .van-sku-row__item--disabled{display:none}.van-sku-row{margin:0 16px 12px}.van-sku-row:last-child{margin-bottom:0}.van-sku-row__image-item,.van-sku-row__item{position:relative;overflow:hidden;color:#323233;border-radius:4px;cursor:pointer}.van-sku-row__image-item::before,.van-sku-row__item::before{position:absolute;top:0;left:0;width:100%;height:100%;background:#f7f8fa;content:''}.van-sku-row__image-item--active,.van-sku-row__item--active{color:#ee0a24}.van-sku-row__image-item--active::before,.van-sku-row__item--active::before{background:currentColor;opacity:.1}.van-sku-row__item{display:-webkit-inline-box;display:-webkit-inline-flex;display:inline-flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;min-width:40px;margin:0 12px 12px 0;font-size:13px;line-height:16px;vertical-align:middle}.van-sku-row__item-img{z-index:1;width:24px;height:24px;margin:4px 0 4px 4px;object-fit:cover;border-radius:2px}.van-sku-row__item-name{z-index:1;padding:8px}.van-sku-row__item--disabled{color:#c8c9cc;background:#f2f3f5;cursor:not-allowed}.van-sku-row__item--disabled .van-sku-row__item-img{opacity:.3}.van-sku-row__image{margin-right:0}.van-sku-row__image-item{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column;width:110px;margin:0 4px 4px 0;border:1px solid transparent}.van-sku-row__image-item:last-child{margin-right:0}.van-sku-row__image-item-img{width:100%;height:110px}.van-sku-row__image-item-img-icon{position:absolute;top:0;right:0;z-index:3;width:18px;height:18px;color:#fff;line-height:18px;text-align:center;background-color:rgba(0,0,0,.4);border-bottom-left-radius:4px}.van-sku-row__image-item-name{position:relative;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;box-sizing:border-box;height:40px;padding:4px;font-size:12px;line-height:16px}.van-sku-row__image-item-name span{word-wrap:break-word}.van-sku-row__image-item--active{border-color:currentColor}.van-sku-row__image-item--disabled{color:#c8c9cc;cursor:not-allowed}.van-sku-row__image-item--disabled::before{z-index:2;background:#f2f3f5;opacity:.4}.van-sku-row__title{padding-bottom:12px}.van-sku-row__title-multiple{color:#969799}.van-sku-row__scroller{margin:0 -16px;overflow-x:scroll;overflow-y:hidden;-webkit-overflow-scrolling:touch}.van-sku-row__scroller::-webkit-scrollbar{display:none}.van-sku-row__row{display:-webkit-inline-box;display:-webkit-inline-flex;display:inline-flex;margin-bottom:4px;padding:0 16px}.van-sku-row__indicator{width:40px;height:4px;background:#ebedf0;border-radius:2px}.van-sku-row__indicator-wrapper{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;padding-bottom:16px}.van-sku-row__indicator-slider{width:50%;height:100%;background-color:#ee0a24;border-radius:2px}.van-sku-stepper-stock{padding:12px 16px;overflow:hidden;line-height:30px}.van-sku__stepper{float:right;padding-left:4px}.van-sku__stepper-title{float:left}.van-sku__stepper-quota{float:right;color:#ee0a24;font-size:12px}.van-sku__stock{display:inline-block;margin-right:8px;color:#969799;font-size:12px}.van-sku__stock-num--highlight{color:#ee0a24}.van-sku-messages{padding-bottom:32px}.van-sku-messages__image-cell .van-cell__title{max-width:6.2em;margin-right:12px;color:#646566;text-align:left;word-wrap:break-word}.van-sku-messages__image-cell .van-cell__value{overflow:visible;text-align:left}.van-sku-messages__image-cell-label{color:#969799;font-size:12px;line-height:18px}.van-sku-messages__cell-block{position:relative}.van-sku-messages__cell-block::after{position:absolute;box-sizing:border-box;content:' ';pointer-events:none;right:16px;bottom:0;left:16px;border-bottom:1px solid #ebedf0;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.van-sku-messages__extra-message{margin-top:-2px;padding:0 16px 12px;color:#969799;font-size:12px;line-height:18px}.van-sku-actions{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-flex-shrink:0;flex-shrink:0;padding:8px 16px}.van-sku-actions .van-button{height:40px;font-weight:500;font-size:14px;border:none;border-radius:0}.van-sku-actions .van-button:first-of-type{border-top-left-radius:20px;border-bottom-left-radius:20px}.van-sku-actions .van-button:last-of-type{border-top-right-radius:20px;border-bottom-right-radius:20px}.van-sku-actions .van-button--warning{background:-webkit-linear-gradient(left,#ffd01e,#ff8917);background:linear-gradient(to right,#ffd01e,#ff8917)}.van-sku-actions .van-button--danger{background:-webkit-linear-gradient(left,#ff6034,#ee0a24);background:linear-gradient(to right,#ff6034,#ee0a24)}
|
1
|
+
.van-sku-container{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column;-webkit-box-align:stretch;-webkit-align-items:stretch;align-items:stretch;min-height:50%;max-height:80%;overflow-y:visible;font-size:14px;background:#fff}.van-sku-body{-webkit-box-flex:1;-webkit-flex:1 1 auto;flex:1 1 auto;min-height:44px;overflow-y:scroll;-webkit-overflow-scrolling:touch}.van-sku-body::-webkit-scrollbar{display:none}.van-sku-header{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-flex-shrink:0;flex-shrink:0;margin:0 16px}.van-sku-header__img-wrap{-webkit-flex-shrink:0;flex-shrink:0;width:96px;height:96px;margin:12px 12px 12px 0;overflow:hidden;border-radius:4px}.van-sku-header__goods-info{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column;-webkit-box-pack:end;-webkit-justify-content:flex-end;justify-content:flex-end;padding:12px 20px 12px 0}.van-sku-header-item{margin-top:8px;color:#969799;font-size:12px;line-height:16px}.van-sku__price-symbol{font-size:16px;vertical-align:bottom}.van-sku__price-num{font-weight:500;font-size:22px;vertical-align:bottom;word-wrap:break-word}.van-sku__goods-price{margin-left:-2px;color:#ee0a24}.van-sku__price-tag{position:relative;display:inline-block;margin-left:8px;padding:0 5px;overflow:hidden;color:#ee0a24;font-size:12px;line-height:16px;border-radius:8px}.van-sku__price-tag::before{position:absolute;top:0;left:0;width:100%;height:100%;background:currentColor;opacity:.1;content:''}.van-sku-group-container{padding-top:12px}.van-sku-group-container--hide-soldout .van-sku-row__item--disabled{display:none}.van-sku-row{margin:0 16px 12px}.van-sku-row:last-child{margin-bottom:0}.van-sku-row__image-item,.van-sku-row__item{position:relative;overflow:hidden;color:#323233;border-radius:4px;cursor:pointer}.van-sku-row__image-item::before,.van-sku-row__item::before{position:absolute;top:0;left:0;width:100%;height:100%;background:#f7f8fa;content:''}.van-sku-row__image-item--active,.van-sku-row__item--active{color:#ee0a24}.van-sku-row__image-item--active::before,.van-sku-row__item--active::before{background:currentColor;opacity:.1}.van-sku-row__item{display:-webkit-inline-box;display:-webkit-inline-flex;display:inline-flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;min-width:40px;margin:0 12px 12px 0;font-size:13px;line-height:16px;vertical-align:middle}.van-sku-row__item-img{z-index:1;width:24px;height:24px;margin:4px 0 4px 4px;object-fit:cover;border-radius:2px}.van-sku-row__item-name{z-index:1;padding:8px}.van-sku-row__item--disabled{color:#c8c9cc;background:#f2f3f5;cursor:not-allowed}.van-sku-row__item--disabled .van-sku-row__item-img{opacity:.3}.van-sku-row__image{margin-right:0}.van-sku-row__image-item{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column;width:110px;margin:0 4px 4px 0;border:1px solid transparent}.van-sku-row__image-item:last-child{margin-right:0}.van-sku-row__image-item-img{width:100%;height:110px}.van-sku-row__image-item-img-icon{position:absolute;top:0;right:0;z-index:3;width:18px;height:18px;color:#fff;line-height:18px;text-align:center;background-color:rgba(0,0,0,.4);border-bottom-left-radius:4px}.van-sku-row__image-item-name{position:relative;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;box-sizing:border-box;height:40px;padding:4px;font-size:12px;line-height:16px}.van-sku-row__image-item-name span{word-wrap:break-word}.van-sku-row__image-item--active{border-color:currentColor}.van-sku-row__image-item--disabled{color:#c8c9cc;cursor:not-allowed}.van-sku-row__image-item--disabled::before{z-index:2;background:#f2f3f5;opacity:.4}.van-sku-row__title{padding-bottom:12px}.van-sku-row__title-multiple{color:#969799}.van-sku-row__scroller{margin:0 -16px;overflow-x:scroll;overflow-y:hidden;-webkit-overflow-scrolling:touch}.van-sku-row__scroller::-webkit-scrollbar{display:none}.van-sku-row__row{display:-webkit-inline-box;display:-webkit-inline-flex;display:inline-flex;margin-bottom:4px;padding:0 16px}.van-sku-row__indicator{width:40px;height:4px;background:#ebedf0;border-radius:2px}.van-sku-row__indicator-wrapper{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;padding-bottom:16px}.van-sku-row__indicator-slider{width:50%;height:100%;background-color:#ee0a24;border-radius:2px}.van-sku-stepper-stock{padding:12px 16px;overflow:hidden;line-height:30px}.van-sku__stepper{float:right;padding-left:4px}.van-sku__stepper-title{float:left}.van-sku__stepper-quota{float:right;color:#ee0a24;font-size:12px}.van-sku__stock{display:inline-block;margin-right:8px;color:#969799;font-size:12px}.van-sku__stock-num--highlight{color:#ee0a24}.van-sku-messages{padding-bottom:32px}.van-sku-messages__image-cell .van-cell__title{max-width:6.2em;margin-right:12px;color:#646566;text-align:left;word-wrap:break-word}.van-sku-messages__image-cell .van-cell__value{overflow:visible;text-align:left}.van-sku-messages__image-cell-label{color:#969799;font-size:12px;line-height:18px}.van-sku-messages__cell-block{position:relative}.van-sku-messages__cell-block::after{position:absolute;box-sizing:border-box;content:' ';pointer-events:none;right:16px;bottom:0;left:16px;border-bottom:1px solid #ebedf0;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.van-sku-messages__cell-block:last-child::after{display:none}.van-sku-messages__extra-message{margin-top:-2px;padding:0 16px 12px;color:#969799;font-size:12px;line-height:18px}.van-sku-actions{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-flex-shrink:0;flex-shrink:0;padding:8px 16px}.van-sku-actions .van-button{height:40px;font-weight:500;font-size:14px;border:none;border-radius:0}.van-sku-actions .van-button:first-of-type{border-top-left-radius:20px;border-bottom-left-radius:20px}.van-sku-actions .van-button:last-of-type{border-top-right-radius:20px;border-bottom-right-radius:20px}.van-sku-actions .van-button--warning{background:-webkit-linear-gradient(left,#ffd01e,#ff8917);background:linear-gradient(to right,#ffd01e,#ff8917)}.van-sku-actions .van-button--danger{background:-webkit-linear-gradient(left,#ff6034,#ee0a24);background:linear-gradient(to right,#ff6034,#ee0a24)}
|
package/lib/sku/index.less
CHANGED
package/lib/switch/index.css
CHANGED
@@ -1 +1 @@
|
|
1
|
-
.van-switch{position:relative;display:inline-block;box-sizing:content-box;width:2em;height:1em;font-size:30px;background-color:#fff;border:1px solid rgba(0,0,0,.1);border-radius:1em;cursor:pointer;-webkit-transition:background-color .3s;transition:background-color .3s}.van-switch__node{position:absolute;top:0;left:0;width:1em;height:1em;background-color:#fff;border-radius:100%;box-shadow:0 3px 1px 0 rgba(0,0,0,.05),0 2px 2px 0 rgba(0,0,0,.1),0 3px 3px 0 rgba(0,0,0,.05);-webkit-transition:-webkit-transform .3s cubic-bezier(.3,1.05,.4,1.05);transition:-webkit-transform .3s cubic-bezier(.3,1.05,.4,1.05);transition:transform .3s cubic-bezier(.3,1.05,.4,1.05);transition:transform .3s cubic-bezier(.3,1.05,.4,1.05),-webkit-transform .3s cubic-bezier(.3,1.05,.4,1.05)}.van-switch__loading{top:25%;left:25%;width:50%;height:50%;line-height:1}.van-switch--on{background-color:#1989fa}.van-switch--on .van-switch__node{-webkit-transform:translateX(1em);transform:translateX(1em)}.van-switch--on .van-switch__loading{color:#1989fa}.van-switch--disabled{cursor:not-allowed;opacity:.5}.van-switch--loading{cursor:default}
|
1
|
+
.van-switch{position:relative;display:inline-block;box-sizing:content-box;width:2em;height:1em;font-size:30px;background-color:#fff;border:1px solid rgba(0,0,0,.1);border-radius:1em;cursor:pointer;-webkit-transition:background-color .3s;transition:background-color .3s}.van-switch__node{position:absolute;top:0;left:0;width:1em;height:1em;font-size:inherit;background-color:#fff;border-radius:100%;box-shadow:0 3px 1px 0 rgba(0,0,0,.05),0 2px 2px 0 rgba(0,0,0,.1),0 3px 3px 0 rgba(0,0,0,.05);-webkit-transition:-webkit-transform .3s cubic-bezier(.3,1.05,.4,1.05);transition:-webkit-transform .3s cubic-bezier(.3,1.05,.4,1.05);transition:transform .3s cubic-bezier(.3,1.05,.4,1.05);transition:transform .3s cubic-bezier(.3,1.05,.4,1.05),-webkit-transform .3s cubic-bezier(.3,1.05,.4,1.05)}.van-switch__loading{top:25%;left:25%;width:50%;height:50%;line-height:1}.van-switch--on{background-color:#1989fa}.van-switch--on .van-switch__node{-webkit-transform:translateX(1em);transform:translateX(1em)}.van-switch--on .van-switch__loading{color:#1989fa}.van-switch--disabled{cursor:not-allowed;opacity:.5}.van-switch--loading{cursor:default}
|
package/lib/switch/index.less
CHANGED
package/lib/tabbar/index.js
CHANGED
@@ -70,23 +70,23 @@ var _default = createComponent({
|
|
70
70
|
var _this = this;
|
71
71
|
|
72
72
|
this.children.forEach(function (item, index) {
|
73
|
-
item.
|
73
|
+
item.nameMatched = (item.name || index) === _this.value;
|
74
74
|
});
|
75
75
|
},
|
76
|
-
|
76
|
+
triggerChange: function triggerChange(active, afterChange) {
|
77
77
|
var _this2 = this;
|
78
78
|
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
}
|
89
|
-
}
|
79
|
+
(0, _interceptor.callInterceptor)({
|
80
|
+
interceptor: this.beforeChange,
|
81
|
+
args: [active],
|
82
|
+
done: function done() {
|
83
|
+
_this2.$emit('input', active);
|
84
|
+
|
85
|
+
_this2.$emit('change', active);
|
86
|
+
|
87
|
+
afterChange();
|
88
|
+
}
|
89
|
+
});
|
90
90
|
},
|
91
91
|
genTabbar: function genTabbar() {
|
92
92
|
var _ref;
|
package/lib/tabbar-item/index.js
CHANGED
@@ -37,11 +37,11 @@ var _default = createComponent({
|
|
37
37
|
}),
|
38
38
|
data: function data() {
|
39
39
|
return {
|
40
|
-
|
40
|
+
nameMatched: false
|
41
41
|
};
|
42
42
|
},
|
43
43
|
computed: {
|
44
|
-
|
44
|
+
routeMatched: function routeMatched() {
|
45
45
|
var to = this.to,
|
46
46
|
$route = this.$route;
|
47
47
|
|
@@ -53,18 +53,27 @@ var _default = createComponent({
|
|
53
53
|
var nameMatched = (0, _utils.isDef)(config.name) && config.name === $route.name;
|
54
54
|
return pathMatched || nameMatched;
|
55
55
|
}
|
56
|
+
},
|
57
|
+
active: function active() {
|
58
|
+
return this.parent.route ? this.routeMatched : this.nameMatched;
|
56
59
|
}
|
57
60
|
},
|
58
61
|
methods: {
|
59
62
|
onClick: function onClick(event) {
|
60
|
-
|
63
|
+
var _this = this;
|
64
|
+
|
65
|
+
if (!this.active) {
|
66
|
+
this.parent.triggerChange(this.name || this.index, function () {
|
67
|
+
(0, _router.route)(_this.$router, _this);
|
68
|
+
});
|
69
|
+
}
|
70
|
+
|
61
71
|
this.$emit('click', event);
|
62
|
-
(0, _router.route)(this.$router, this);
|
63
72
|
},
|
64
|
-
genIcon: function genIcon(
|
73
|
+
genIcon: function genIcon() {
|
65
74
|
var h = this.$createElement;
|
66
75
|
var slot = this.slots('icon', {
|
67
|
-
active: active
|
76
|
+
active: this.active
|
68
77
|
});
|
69
78
|
|
70
79
|
if (slot) {
|
@@ -85,7 +94,7 @@ var _default = createComponent({
|
|
85
94
|
var _this$badge;
|
86
95
|
|
87
96
|
var h = arguments[0];
|
88
|
-
var active = this.
|
97
|
+
var active = this.active;
|
89
98
|
var color = this.parent[active ? 'activeColor' : 'inactiveColor'];
|
90
99
|
|
91
100
|
if (process.env.NODE_ENV === 'development' && this.info) {
|
@@ -104,7 +113,7 @@ var _default = createComponent({
|
|
104
113
|
}
|
105
114
|
}, [h("div", {
|
106
115
|
"class": bem('icon')
|
107
|
-
}, [this.genIcon(
|
116
|
+
}, [this.genIcon(), h(_info.default, {
|
108
117
|
"attrs": {
|
109
118
|
"dot": this.dot,
|
110
119
|
"info": (_this$badge = this.badge) != null ? _this$badge : this.info
|