weapp版本升级到1.11.7
"version": "1.11.7"
This commit is contained in:
1 parent
a3c886146a
commit
66ba21dd7b
67 files changed
+566
-365
No files matched your search
+5
@@ -47,6 +47,10 @@ var defaultFieldNames = {
|
||||
type: Boolean,
|
||||
value: true,
|
||||
},
|
||||
ellipsis: {
|
||||
type: Boolean,
|
||||
value: true,
|
||||
},
|
||||
showHeader: {
|
||||
type: Boolean,
|
||||
value: true,
|
||||
@@ -161,6 +165,7 @@ var defaultFieldNames = {
|
||||
selected: null,
|
||||
},
|
||||
],
|
||||
activeTab: 0,
|
||||
});
|
||||
},
|
||||
onClose: function () {
|
||||
|
||||
+1
@@ -19,6 +19,7 @@
|
||||
color="{{ activeColor }}"
|
||||
border="{{ false }}"
|
||||
swipeable="{{ swipeable }}"
|
||||
ellipsis="{{ ellipsis }}"
|
||||
bind:click="onClickTab"
|
||||
>
|
||||
<van-tab
|
||||
|
||||
+3
-2
@@ -26,6 +26,7 @@ var animate_1 = require("./animate");
|
||||
},
|
||||
data: {
|
||||
expanded: false,
|
||||
parentBorder: true,
|
||||
},
|
||||
mounted: function () {
|
||||
this.updateExpanded();
|
||||
@@ -36,7 +37,7 @@ var animate_1 = require("./animate");
|
||||
if (!this.parent) {
|
||||
return;
|
||||
}
|
||||
var _a = this.parent.data, value = _a.value, accordion = _a.accordion;
|
||||
var _a = this.parent.data, value = _a.value, accordion = _a.accordion, border = _a.border;
|
||||
var _b = this.parent.children, children = _b === void 0 ? [] : _b;
|
||||
var name = this.data.name;
|
||||
var index = children.indexOf(this);
|
||||
@@ -47,7 +48,7 @@ var animate_1 = require("./animate");
|
||||
if (expanded !== this.data.expanded) {
|
||||
(0, animate_1.setContentAnimate)(this, expanded, this.mounted);
|
||||
}
|
||||
this.setData({ index: index, expanded: expanded });
|
||||
this.setData({ index: index, expanded: expanded, parentBorder: border });
|
||||
},
|
||||
onClick: function () {
|
||||
if (this.data.disabled) {
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
<wxs src="../wxs/utils.wxs" module="utils" />
|
||||
|
||||
<view class="van-collapse-item custom-class {{ index !== 0 ? 'van-hairline--top' : '' }}">
|
||||
<view class="van-collapse-item custom-class {{ index !== 0 && parentBorder ? 'van-hairline--top' : '' }}">
|
||||
<van-cell
|
||||
size="{{ size }}"
|
||||
title="{{ title }}"
|
||||
|
||||
+1
@@ -4,6 +4,7 @@ interface VantComponentInstance {
|
||||
children: WechatMiniprogram.Component.TrivialInstance[];
|
||||
index: number;
|
||||
$emit: (name: string, detail?: unknown, options?: WechatMiniprogram.Component.TriggerEventOption) => void;
|
||||
setView: (value: Record<string, any>, callback?: () => void) => void;
|
||||
}
|
||||
export type VantComponentOptions<Data extends WechatMiniprogram.Component.DataOption, Props extends WechatMiniprogram.Component.PropertyOption, Methods extends WechatMiniprogram.Component.MethodOption> = {
|
||||
data?: Data;
|
||||
|
||||
+9
-8
@@ -90,15 +90,16 @@ var utils_1 = require("../common/utils");
|
||||
this.close('overlay');
|
||||
},
|
||||
close: function (action) {
|
||||
var _this = this;
|
||||
this.setData({ show: false });
|
||||
wx.nextTick(function () {
|
||||
_this.$emit('close', action);
|
||||
var callback = _this.data.callback;
|
||||
if (callback) {
|
||||
callback(action, _this);
|
||||
}
|
||||
});
|
||||
this.closeAction = action;
|
||||
},
|
||||
onAfterLeave: function () {
|
||||
var action = this.closeAction;
|
||||
this.$emit('close', action);
|
||||
var callback = this.data.callback;
|
||||
if (callback) {
|
||||
callback(action, this);
|
||||
}
|
||||
},
|
||||
stopLoading: function () {
|
||||
this.setData({
|
||||
|
||||
+1
@@ -11,6 +11,7 @@
|
||||
close-on-click-overlay="{{ closeOnClickOverlay }}"
|
||||
root-portal="{{ rootPortal }}"
|
||||
bind:close="onClickOverlay"
|
||||
bind:after-leave="onAfterLeave"
|
||||
>
|
||||
<view
|
||||
wx:if="{{ title || useTitleSlot }}"
|
||||
|
||||
+16
-1
@@ -44,6 +44,18 @@ var props_1 = require("./props");
|
||||
innerValue: '',
|
||||
showClear: false,
|
||||
},
|
||||
watch: {
|
||||
value: function (value) {
|
||||
if (value !== this.value) {
|
||||
this.setData({ innerValue: value });
|
||||
this.value = value;
|
||||
this.setShowClear();
|
||||
}
|
||||
},
|
||||
clearTrigger: function () {
|
||||
this.setShowClear();
|
||||
},
|
||||
},
|
||||
created: function () {
|
||||
this.value = this.data.value;
|
||||
this.setData({ innerValue: this.value });
|
||||
@@ -109,6 +121,9 @@ var props_1 = require("./props");
|
||||
onKeyboardHeightChange: function (event) {
|
||||
this.$emit('keyboardheightchange', event.detail);
|
||||
},
|
||||
onBindNicknameReview: function (event) {
|
||||
this.$emit('nicknamereview', event.detail);
|
||||
},
|
||||
emitChange: function (detail) {
|
||||
var extraEventParams = this.data.extraEventParams;
|
||||
this.setData({ value: detail.value });
|
||||
@@ -130,7 +145,7 @@ var props_1 = require("./props");
|
||||
var trigger = clearTrigger === 'always' || (clearTrigger === 'focus' && focused);
|
||||
showClear = hasValue && trigger;
|
||||
}
|
||||
this.setData({ showClear: showClear });
|
||||
this.setView({ showClear: showClear });
|
||||
},
|
||||
noop: function () { },
|
||||
},
|
||||
|
||||
+1
@@ -27,4 +27,5 @@
|
||||
bindfocus="onFocus"
|
||||
bindconfirm="onConfirm"
|
||||
bindkeyboardheightchange="onKeyboardHeightChange"
|
||||
bindnicknamereview="onBindNicknameReview"
|
||||
/>
|
||||
+1
-9
@@ -2,15 +2,7 @@
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.textareaProps = exports.inputProps = exports.commonProps = void 0;
|
||||
exports.commonProps = {
|
||||
value: {
|
||||
type: String,
|
||||
observer: function (value) {
|
||||
if (value !== this.value) {
|
||||
this.setData({ innerValue: value });
|
||||
this.value = value;
|
||||
}
|
||||
},
|
||||
},
|
||||
value: String,
|
||||
placeholder: String,
|
||||
placeholderStyle: String,
|
||||
placeholderClass: String,
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
@import '../common/index.wxss';.van-image{display:inline-block;position:relative}.van-image--round{border-radius:50%;overflow:hidden}.van-image--round .van-image__img{border-radius:inherit}.van-image__error,.van-image__img,.van-image__loading{display:block;height:100%;width:100%}.van-image__error,.van-image__loading{align-items:center;background-color:var(--image-placeholder-background-color,#f7f8fa);color:var(--image-placeholder-text-color,#969799);display:flex;flex-direction:column;font-size:var(--image-placeholder-font-size,14px);justify-content:center;left:0;position:absolute;top:0}.van-image__loading-icon{color:var(--image-loading-icon-color,#dcdee0);font-size:var(--image-loading-icon-size,32px)!important}.van-image__error-icon{color:var(--image-error-icon-color,#dcdee0);font-size:var(--image-error-icon-size,32px)!important}
|
||||
@import '../common/index.wxss';.van-image{display:inline-block;position:relative;vertical-align:top}.van-image--round{border-radius:50%;overflow:hidden}.van-image--round .van-image__img{border-radius:inherit}.van-image__error,.van-image__img,.van-image__loading{display:block;height:100%;width:100%}.van-image__error,.van-image__loading{align-items:center;background-color:var(--image-placeholder-background-color,#f7f8fa);color:var(--image-placeholder-text-color,#969799);display:flex;flex-direction:column;font-size:var(--image-placeholder-font-size,14px);justify-content:center;left:0;position:absolute;top:0}.van-image__loading-icon{color:var(--image-loading-icon-color,#dcdee0);font-size:var(--image-loading-icon-size,32px)!important}.van-image__error-icon{color:var(--image-error-icon-color,#dcdee0);font-size:var(--image-error-icon-size,32px)!important}
|
||||
+16
@@ -10,5 +10,21 @@ exports.basic = Behavior({
|
||||
this.setData(data);
|
||||
return new Promise(function (resolve) { return wx.nextTick(resolve); });
|
||||
},
|
||||
// high performance setData
|
||||
setView: function (data, callback) {
|
||||
var _this = this;
|
||||
var target = {};
|
||||
var hasChange = false;
|
||||
Object.keys(data).forEach(function (key) {
|
||||
if (data[key] !== _this.data[key]) {
|
||||
target[key] = data[key];
|
||||
hasChange = true;
|
||||
}
|
||||
});
|
||||
if (hasChange) {
|
||||
return this.setData(target, callback);
|
||||
}
|
||||
return callback && callback();
|
||||
},
|
||||
},
|
||||
});
|
||||
+59
-51
@@ -24,7 +24,6 @@ function transition(showDefaultValue) {
|
||||
duration: {
|
||||
type: null,
|
||||
value: 300,
|
||||
observer: 'observeDuration',
|
||||
},
|
||||
name: {
|
||||
type: String,
|
||||
@@ -46,76 +45,85 @@ function transition(showDefaultValue) {
|
||||
if (value === old) {
|
||||
return;
|
||||
}
|
||||
value ? this.enter() : this.leave();
|
||||
value ? this.enureEnter() : this.enureLeave();
|
||||
},
|
||||
enter: function () {
|
||||
enureEnter: function () {
|
||||
var _this = this;
|
||||
if (this.enterFinishedPromise)
|
||||
if (this.enterPromise)
|
||||
return;
|
||||
this.enterFinishedPromise = new Promise(function (resolve) {
|
||||
var _a = _this.data, duration = _a.duration, name = _a.name;
|
||||
var classNames = getClassNames(name);
|
||||
var currentDuration = (0, validator_1.isObj)(duration) ? duration.enter : duration;
|
||||
if (_this.status === 'enter') {
|
||||
this.enterPromise = new Promise(function (resolve) { return _this.enter(resolve); });
|
||||
},
|
||||
enureLeave: function () {
|
||||
var _this = this;
|
||||
var enterPromise = this.enterPromise;
|
||||
if (!enterPromise)
|
||||
return;
|
||||
enterPromise
|
||||
.then(function () { return new Promise(function (resolve) { return _this.leave(resolve); }); })
|
||||
.then(function () {
|
||||
_this.enterPromise = null;
|
||||
});
|
||||
},
|
||||
enter: function (resolve) {
|
||||
var _this = this;
|
||||
var _a = this.data, duration = _a.duration, name = _a.name;
|
||||
var classNames = getClassNames(name);
|
||||
var currentDuration = (0, validator_1.isObj)(duration) ? duration.enter : duration;
|
||||
if (this.status === 'enter') {
|
||||
return;
|
||||
}
|
||||
this.status = 'enter';
|
||||
this.$emit('before-enter');
|
||||
(0, utils_1.requestAnimationFrame)(function () {
|
||||
if (_this.status !== 'enter') {
|
||||
return;
|
||||
}
|
||||
_this.status = 'enter';
|
||||
_this.$emit('before-enter');
|
||||
_this.$emit('enter');
|
||||
_this.setData({
|
||||
inited: true,
|
||||
display: true,
|
||||
classes: classNames.enter,
|
||||
currentDuration: currentDuration,
|
||||
});
|
||||
(0, utils_1.requestAnimationFrame)(function () {
|
||||
if (_this.status !== 'enter') {
|
||||
return;
|
||||
}
|
||||
_this.$emit('enter');
|
||||
_this.setData({
|
||||
inited: true,
|
||||
display: true,
|
||||
classes: classNames.enter,
|
||||
currentDuration: currentDuration,
|
||||
});
|
||||
(0, utils_1.requestAnimationFrame)(function () {
|
||||
if (_this.status !== 'enter') {
|
||||
return;
|
||||
}
|
||||
_this.transitionEnded = false;
|
||||
_this.setData({ classes: classNames['enter-to'] });
|
||||
resolve();
|
||||
});
|
||||
_this.transitionEnded = false;
|
||||
_this.setData({ classes: classNames['enter-to'] });
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
},
|
||||
leave: function () {
|
||||
leave: function (resolve) {
|
||||
var _this = this;
|
||||
if (!this.enterFinishedPromise)
|
||||
if (!this.data.display) {
|
||||
return;
|
||||
this.enterFinishedPromise.then(function () {
|
||||
if (!_this.data.display) {
|
||||
}
|
||||
var _a = this.data, duration = _a.duration, name = _a.name;
|
||||
var classNames = getClassNames(name);
|
||||
var currentDuration = (0, validator_1.isObj)(duration) ? duration.leave : duration;
|
||||
this.status = 'leave';
|
||||
this.$emit('before-leave');
|
||||
(0, utils_1.requestAnimationFrame)(function () {
|
||||
if (_this.status !== 'leave') {
|
||||
return;
|
||||
}
|
||||
var _a = _this.data, duration = _a.duration, name = _a.name;
|
||||
var classNames = getClassNames(name);
|
||||
var currentDuration = (0, validator_1.isObj)(duration) ? duration.leave : duration;
|
||||
_this.status = 'leave';
|
||||
_this.$emit('before-leave');
|
||||
_this.$emit('leave');
|
||||
_this.setData({
|
||||
classes: classNames.leave,
|
||||
currentDuration: currentDuration,
|
||||
});
|
||||
(0, utils_1.requestAnimationFrame)(function () {
|
||||
if (_this.status !== 'leave') {
|
||||
return;
|
||||
}
|
||||
_this.$emit('leave');
|
||||
_this.setData({
|
||||
classes: classNames.leave,
|
||||
currentDuration: currentDuration,
|
||||
});
|
||||
(0, utils_1.requestAnimationFrame)(function () {
|
||||
if (_this.status !== 'leave') {
|
||||
return;
|
||||
}
|
||||
_this.transitionEnded = false;
|
||||
setTimeout(function () {
|
||||
_this.onTransitionEnd();
|
||||
_this.enterFinishedPromise = null;
|
||||
}, currentDuration);
|
||||
_this.setData({ classes: classNames['leave-to'] });
|
||||
});
|
||||
_this.transitionEnded = false;
|
||||
setTimeout(function () {
|
||||
_this.onTransitionEnd();
|
||||
resolve();
|
||||
}, currentDuration);
|
||||
_this.setData({ classes: classNames['leave-to'] });
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
+19
-12
@@ -64,7 +64,7 @@ var utils_1 = require("../common/utils");
|
||||
(0, utils_1.getRect)(_this, '.van-notice-bar__wrap'),
|
||||
]).then(function (rects) {
|
||||
var contentRect = rects[0], wrapRect = rects[1];
|
||||
var _a = _this.data, speed = _a.speed, scrollable = _a.scrollable, delay = _a.delay;
|
||||
var scrollable = _this.data.scrollable;
|
||||
if (contentRect == null ||
|
||||
wrapRect == null ||
|
||||
!contentRect.width ||
|
||||
@@ -73,20 +73,26 @@ var utils_1 = require("../common/utils");
|
||||
return;
|
||||
}
|
||||
if (scrollable || wrapRect.width < contentRect.width) {
|
||||
var duration = ((wrapRect.width + contentRect.width) / speed) * 1000;
|
||||
_this.wrapWidth = wrapRect.width;
|
||||
_this.contentWidth = contentRect.width;
|
||||
_this.duration = duration;
|
||||
_this.animation = wx.createAnimation({
|
||||
duration: duration,
|
||||
timingFunction: 'linear',
|
||||
delay: delay,
|
||||
});
|
||||
_this.initAnimation(wrapRect.width, contentRect.width);
|
||||
_this.scroll(true);
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
initAnimation: function (warpWidth, contentWidth) {
|
||||
var _a = this.data, speed = _a.speed, delay = _a.delay;
|
||||
this.wrapWidth = warpWidth;
|
||||
this.contentWidth = contentWidth;
|
||||
// begin 0
|
||||
this.contentDuration = (contentWidth / speed) * 1000;
|
||||
// begin -wrapWidth
|
||||
this.duration = ((warpWidth + contentWidth) / speed) * 1000;
|
||||
this.animation = wx.createAnimation({
|
||||
duration: this.contentDuration,
|
||||
timingFunction: 'linear',
|
||||
delay: delay,
|
||||
});
|
||||
},
|
||||
scroll: function (isInit) {
|
||||
var _this = this;
|
||||
if (isInit === void 0) { isInit = false; }
|
||||
@@ -98,17 +104,18 @@ var utils_1 = require("../common/utils");
|
||||
.step()
|
||||
.export(),
|
||||
});
|
||||
var duration = isInit ? this.contentDuration : this.duration;
|
||||
(0, utils_1.requestAnimationFrame)(function () {
|
||||
_this.setData({
|
||||
animationData: _this.animation
|
||||
.translateX(-_this.contentWidth)
|
||||
.step()
|
||||
.step({ duration: duration })
|
||||
.export(),
|
||||
});
|
||||
});
|
||||
this.timer = setTimeout(function () {
|
||||
_this.scroll();
|
||||
}, this.duration + this.data.delay);
|
||||
}, duration + this.data.delay);
|
||||
},
|
||||
onClickIcon: function (event) {
|
||||
if (this.data.mode === 'closeable') {
|
||||
|
||||
+23
-27
@@ -85,18 +85,18 @@ function equal(value1, value2) {
|
||||
},
|
||||
created: function () {
|
||||
this.setData({
|
||||
currentValue: this.format(this.data.value),
|
||||
currentValue: this.format(this.data.value).newValue,
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
observeValue: function () {
|
||||
var value = this.data.value;
|
||||
this.setData({ currentValue: this.format(value) });
|
||||
this.setData({ currentValue: this.format(value).newValue });
|
||||
},
|
||||
check: function () {
|
||||
var val = this.format(this.data.currentValue);
|
||||
if (!equal(val, this.data.currentValue)) {
|
||||
this.setData({ currentValue: val });
|
||||
var newValue = this.format(this.data.currentValue).newValue;
|
||||
if (!equal(newValue, this.data.currentValue)) {
|
||||
this.setData({ currentValue: newValue });
|
||||
}
|
||||
},
|
||||
isDisabled: function (type) {
|
||||
@@ -110,10 +110,10 @@ function equal(value1, value2) {
|
||||
this.$emit('focus', event.detail);
|
||||
},
|
||||
onBlur: function (event) {
|
||||
var value = this.format(event.detail.value);
|
||||
this.setData({ currentValue: value });
|
||||
this.emitChange(value);
|
||||
this.$emit('blur', __assign(__assign({}, event.detail), { value: value }));
|
||||
var data = this.format(event.detail.value);
|
||||
this.setData({ currentValue: data.newValue });
|
||||
this.emitChange(data);
|
||||
this.$emit('blur', __assign(__assign({}, event.detail), { value: +data.newValue }));
|
||||
},
|
||||
// filter illegal characters
|
||||
filter: function (value) {
|
||||
@@ -123,17 +123,16 @@ function equal(value1, value2) {
|
||||
}
|
||||
return value;
|
||||
},
|
||||
// limit value range
|
||||
format: function (value) {
|
||||
value = this.filter(value);
|
||||
// filter illegal characters and format integer
|
||||
var safeValue = this.filter(value);
|
||||
// format range
|
||||
value = value === '' ? 0 : +value;
|
||||
value = Math.max(Math.min(this.data.max, value), this.data.min);
|
||||
var rangeValue = Math.max(Math.min(this.data.max, +safeValue), this.data.min);
|
||||
// format decimal
|
||||
if ((0, validator_1.isDef)(this.data.decimalLength)) {
|
||||
value = value.toFixed(this.data.decimalLength);
|
||||
}
|
||||
return value;
|
||||
var newValue = (0, validator_1.isDef)(this.data.decimalLength)
|
||||
? rangeValue.toFixed(this.data.decimalLength)
|
||||
: String(rangeValue);
|
||||
return { value: value, newValue: newValue };
|
||||
},
|
||||
onInput: function (event) {
|
||||
var _a = (event.detail || {}).value, value = _a === void 0 ? '' : _a;
|
||||
@@ -141,19 +140,16 @@ function equal(value1, value2) {
|
||||
if (value === '') {
|
||||
return;
|
||||
}
|
||||
var formatted = this.filter(value);
|
||||
// limit max decimal length
|
||||
if ((0, validator_1.isDef)(this.data.decimalLength) && formatted.indexOf('.') !== -1) {
|
||||
var pair = formatted.split('.');
|
||||
formatted = "".concat(pair[0], ".").concat(pair[1].slice(0, this.data.decimalLength));
|
||||
}
|
||||
var formatted = this.format(value);
|
||||
this.emitChange(formatted);
|
||||
},
|
||||
emitChange: function (value) {
|
||||
emitChange: function (data) {
|
||||
var value = data.value, newValue = data.newValue;
|
||||
if (!this.data.asyncChange) {
|
||||
this.setData({ currentValue: value });
|
||||
// fix when input 11. parsed to 11, unable to enter decimal
|
||||
this.setData({ currentValue: +value === +newValue ? value : newValue });
|
||||
}
|
||||
this.$emit('change', value);
|
||||
this.$emit('change', +newValue);
|
||||
},
|
||||
onChange: function () {
|
||||
var type = this.type;
|
||||
@@ -162,7 +158,7 @@ function equal(value1, value2) {
|
||||
return;
|
||||
}
|
||||
var diff = type === 'minus' ? -this.data.step : +this.data.step;
|
||||
var value = this.format(add(+this.data.currentValue, diff));
|
||||
var value = this.format(String(add(+this.data.currentValue, diff)));
|
||||
this.emitChange(value);
|
||||
this.$emit(type);
|
||||
},
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
@import '../common/index.wxss';.van-steps{background-color:var(--steps-background-color,#fff);overflow:hidden}.van-steps--horizontal{padding:10px}.van-steps--horizontal .van-step__wrapper{display:flex;overflow:hidden;position:relative}.van-steps--vertical{padding-left:10px}.van-steps--vertical .van-step__wrapper{padding:0 0 0 20px}.van-step{color:var(--step-text-color,#969799);flex:1;font-size:var(--step-font-size,14px);position:relative}.van-step--finish{color:var(--step-finish-text-color,#323233)}.van-step__circle{background-color:var(--step-circle-color,#969799);border-radius:50%;height:var(--step-circle-size,5px);width:var(--step-circle-size,5px)}.van-step--horizontal{padding-bottom:14px}.van-step--horizontal:first-child .van-step__title{transform:none}.van-step--horizontal:first-child .van-step__circle-container{padding:0 8px 0 0;transform:translate3d(0,50%,0)}.van-step--horizontal:last-child{position:absolute;right:0;width:auto}.van-step--horizontal:last-child .van-step__title{text-align:right;transform:none}.van-step--horizontal:last-child .van-step__circle-container{padding:0 0 0 8px;right:0;transform:translate3d(0,50%,0)}.van-step--horizontal .van-step__circle-container{background-color:#fff;bottom:6px;padding:0 var(--padding-xs,8px);position:absolute;transform:translate3d(-50%,50%,0);z-index:1}.van-step--horizontal .van-step__title{display:inline-block;font-size:var(--step-horizontal-title-font-size,12px);transform:translate3d(-50%,0,0)}.van-step--horizontal .van-step__line{background-color:var(--step-line-color,#ebedf0);bottom:6px;height:1px;left:0;position:absolute;right:0;transform:translate3d(0,50%,0)}.van-step--horizontal.van-step--process{color:var(--step-process-text-color,#323233)}.van-step--horizontal.van-step--process .van-step__icon{display:block;font-size:var(--step-icon-size,12px);line-height:1}.van-step--vertical{line-height:18px;padding:10px 10px 10px 0}.van-step--vertical:after{border-bottom-width:1px}.van-step--vertical:last-child:after{border-bottom-width:none}.van-step--vertical:first-child:before{background-color:#fff;content:"";height:20px;left:-15px;position:absolute;top:0;width:1px;z-index:1}.van-step--vertical .van-step__circle,.van-step--vertical .van-step__icon,.van-step--vertical .van-step__line{left:-14px;position:absolute;top:19px;transform:translate3d(-50%,-50%,0);z-index:2}.van-step--vertical .van-step__icon{background-color:var(--steps-background-color,#fff);font-size:var(--step-icon-size,12px);line-height:1}.van-step--vertical .van-step__line{background-color:var(--step-line-color,#ebedf0);height:100%;transform:translate3d(-50%,0,0);width:1px;z-index:1}
|
||||
@import '../common/index.wxss';.van-steps{background-color:var(--steps-background-color,#fff);overflow:hidden}.van-steps--horizontal{padding:10px}.van-steps--horizontal .van-step__wrapper{display:flex;overflow:hidden;position:relative}.van-steps--vertical{padding-left:10px}.van-steps--vertical .van-step__wrapper{padding:0 0 0 20px}.van-step{color:var(--step-text-color,#969799);flex:1;font-size:var(--step-font-size,14px);position:relative}.van-step--finish{color:var(--step-finish-text-color,#323233)}.van-step__circle{background-color:var(--step-circle-color,#969799);border-radius:50%;height:var(--step-circle-size,5px);width:var(--step-circle-size,5px)}.van-step--horizontal{padding-bottom:14px}.van-step--horizontal:first-child .van-step__title{transform:none}.van-step--horizontal:first-child .van-step__circle-container{padding:0 8px 0 0;transform:translate3d(0,50%,0)}.van-step--horizontal:last-child{bottom:0;position:absolute;right:0;top:0;width:auto}.van-step--horizontal:last-child .van-step__title{text-align:right;transform:none}.van-step--horizontal:last-child .van-step__circle-container{padding:0 0 0 8px;right:0;transform:translate3d(0,50%,0)}.van-step--horizontal .van-step__circle-container{background-color:#fff;bottom:6px;padding:0 var(--padding-xs,8px);position:absolute;transform:translate3d(-50%,50%,0);z-index:1}.van-step--horizontal .van-step__title{display:inline-block;font-size:var(--step-horizontal-title-font-size,12px);transform:translate3d(-50%,0,0)}.van-step--horizontal .van-step__line{background-color:var(--step-line-color,#ebedf0);bottom:6px;height:1px;left:0;position:absolute;right:0;transform:translate3d(0,50%,0)}.van-step--horizontal.van-step--process{color:var(--step-process-text-color,#323233)}.van-step--horizontal.van-step--process .van-step__icon{display:block;font-size:var(--step-icon-size,12px);line-height:1}.van-step--vertical{line-height:18px;padding:10px 10px 10px 0}.van-step--vertical:after{border-bottom-width:1px}.van-step--vertical:last-child:after{border-bottom-width:none}.van-step--vertical:first-child:before{background-color:#fff;content:"";height:20px;left:-15px;position:absolute;top:0;width:1px;z-index:1}.van-step--vertical .van-step__circle,.van-step--vertical .van-step__icon,.van-step--vertical .van-step__line{left:-14px;position:absolute;top:19px;transform:translate3d(-50%,-50%,0);z-index:2}.van-step--vertical .van-step__icon{background-color:var(--steps-background-color,#fff);font-size:var(--step-icon-size,12px);line-height:1}.van-step--vertical .van-step__line{background-color:var(--step-line-color,#ebedf0);height:100%;transform:translate3d(-50%,0,0);width:1px;z-index:1}
|
||||
+4
-2
@@ -12,9 +12,9 @@ var __assign = (this && this.__assign) || function () {
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var component_1 = require("../common/component");
|
||||
var utils_1 = require("./utils");
|
||||
var shared_1 = require("./shared");
|
||||
var validator_1 = require("../common/validator");
|
||||
var shared_1 = require("./shared");
|
||||
var utils_1 = require("./utils");
|
||||
(0, component_1.VantComponent)({
|
||||
props: __assign(__assign(__assign(__assign({ disabled: Boolean, multiple: Boolean, uploadText: String, useBeforeRead: Boolean, afterRead: null, beforeRead: null, previewSize: {
|
||||
type: null,
|
||||
@@ -168,6 +168,8 @@ var validator_1 = require("../common/validator");
|
||||
});
|
||||
},
|
||||
onPreviewFile: function (event) {
|
||||
if (!this.data.previewFile)
|
||||
return;
|
||||
var index = event.currentTarget.dataset.index;
|
||||
wx.openDocument({
|
||||
filePath: this.data.lists[index].url,
|
||||
|
||||
+1
@@ -29,6 +29,7 @@
|
||||
poster="{{ item.thumb }}"
|
||||
autoplay="{{ item.autoplay }}"
|
||||
object-fit="{{videoFit}}"
|
||||
referrer-policy="{{ referrerPolicy }}"
|
||||
class="van-uploader__preview-image"
|
||||
style="{{ computed.sizeStyle({ previewSize }) }}"
|
||||
data-index="{{ index }}"
|
||||
|
||||
+8
@@ -29,6 +29,10 @@ export declare const videoProps: {
|
||||
type: StringConstructor;
|
||||
value: string;
|
||||
};
|
||||
referrerPolicy: {
|
||||
type: StringConstructor;
|
||||
value: string;
|
||||
};
|
||||
};
|
||||
export declare const mediaProps: {
|
||||
capture: {
|
||||
@@ -50,4 +54,8 @@ export declare const mediaProps: {
|
||||
};
|
||||
export declare const messageFileProps: {
|
||||
extension: null;
|
||||
previewFile: {
|
||||
type: BooleanConstructor;
|
||||
value: boolean;
|
||||
};
|
||||
};
|
||||
+8
@@ -34,6 +34,10 @@ exports.videoProps = {
|
||||
type: String,
|
||||
value: 'back',
|
||||
},
|
||||
referrerPolicy: {
|
||||
type: String,
|
||||
value: 'no-referrer',
|
||||
},
|
||||
};
|
||||
// props for media
|
||||
exports.mediaProps = {
|
||||
@@ -57,4 +61,8 @@ exports.mediaProps = {
|
||||
// props for file
|
||||
exports.messageFileProps = {
|
||||
extension: null,
|
||||
previewFile: {
|
||||
type: Boolean,
|
||||
value: true,
|
||||
},
|
||||
};
|
||||
Reference in new issue
Block a user