mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-05-20 13:49:14 +08:00
build: compile 1.11.6
This commit is contained in:
parent
22f39e86b9
commit
e5f462263b
1
dist/cascader/index.js
vendored
1
dist/cascader/index.js
vendored
@ -148,6 +148,7 @@ VantComponent({
|
||||
selected: null,
|
||||
},
|
||||
],
|
||||
activeTab: 0,
|
||||
});
|
||||
},
|
||||
onClose() {
|
||||
|
1
dist/definitions/index.d.ts
vendored
1
dist/definitions/index.d.ts
vendored
@ -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;
|
||||
|
14
dist/field/index.js
vendored
14
dist/field/index.js
vendored
@ -31,6 +31,18 @@ VantComponent({
|
||||
innerValue: '',
|
||||
showClear: false,
|
||||
},
|
||||
watch: {
|
||||
value(value) {
|
||||
if (value !== this.value) {
|
||||
this.setData({ innerValue: value });
|
||||
this.value = value;
|
||||
this.setShowClear();
|
||||
}
|
||||
},
|
||||
clearTrigger() {
|
||||
this.setShowClear();
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.value = this.data.value;
|
||||
this.setData({ innerValue: this.value });
|
||||
@ -119,7 +131,7 @@ VantComponent({
|
||||
const trigger = clearTrigger === 'always' || (clearTrigger === 'focus' && focused);
|
||||
showClear = hasValue && trigger;
|
||||
}
|
||||
this.setData({ showClear });
|
||||
this.setView({ showClear });
|
||||
},
|
||||
noop() { },
|
||||
},
|
||||
|
10
dist/field/props.js
vendored
10
dist/field/props.js
vendored
@ -1,13 +1,5 @@
|
||||
export const commonProps = {
|
||||
value: {
|
||||
type: String,
|
||||
observer(value) {
|
||||
if (value !== this.value) {
|
||||
this.setData({ innerValue: value });
|
||||
this.value = value;
|
||||
}
|
||||
},
|
||||
},
|
||||
value: String,
|
||||
placeholder: String,
|
||||
placeholderStyle: String,
|
||||
placeholderClass: String,
|
||||
|
15
dist/mixins/basic.js
vendored
15
dist/mixins/basic.js
vendored
@ -7,5 +7,20 @@ export const basic = Behavior({
|
||||
this.setData(data);
|
||||
return new Promise((resolve) => wx.nextTick(resolve));
|
||||
},
|
||||
// high performance setData
|
||||
setView(data, callback) {
|
||||
const target = {};
|
||||
let hasChange = false;
|
||||
Object.keys(data).forEach((key) => {
|
||||
if (data[key] !== this.data[key]) {
|
||||
target[key] = data[key];
|
||||
hasChange = true;
|
||||
}
|
||||
});
|
||||
if (hasChange) {
|
||||
return this.setData(target, callback);
|
||||
}
|
||||
return callback && callback();
|
||||
},
|
||||
},
|
||||
});
|
||||
|
4
dist/uploader/index.js
vendored
4
dist/uploader/index.js
vendored
@ -1,7 +1,7 @@
|
||||
import { VantComponent } from '../common/component';
|
||||
import { isImageFile, chooseFile, isVideoFile } from './utils';
|
||||
import { imageProps, videoProps, mediaProps, messageFileProps } from './shared';
|
||||
import { isBoolean, isPromise } from '../common/validator';
|
||||
import { imageProps, mediaProps, messageFileProps, videoProps } from './shared';
|
||||
import { chooseFile, isImageFile, isVideoFile } from './utils';
|
||||
VantComponent({
|
||||
props: Object.assign(Object.assign(Object.assign(Object.assign({ disabled: Boolean, multiple: Boolean, uploadText: String, useBeforeRead: Boolean, afterRead: null, beforeRead: null, previewSize: {
|
||||
type: null,
|
||||
|
1
dist/uploader/index.wxml
vendored
1
dist/uploader/index.wxml
vendored
@ -29,6 +29,7 @@
|
||||
poster="{{ item.thumb }}"
|
||||
autoplay="{{ item.autoplay }}"
|
||||
object-fit="{{videoFit}}"
|
||||
referrer-policy="{{videoReferrerPolicy}}"
|
||||
class="van-uploader__preview-image"
|
||||
style="{{ computed.sizeStyle({ previewSize }) }}"
|
||||
data-index="{{ index }}"
|
||||
|
4
dist/uploader/shared.d.ts
vendored
4
dist/uploader/shared.d.ts
vendored
@ -29,6 +29,10 @@ export declare const videoProps: {
|
||||
type: StringConstructor;
|
||||
value: string;
|
||||
};
|
||||
referrerPolicy: {
|
||||
type: StringConstructor;
|
||||
value: string;
|
||||
};
|
||||
};
|
||||
export declare const mediaProps: {
|
||||
capture: {
|
||||
|
4
dist/uploader/shared.js
vendored
4
dist/uploader/shared.js
vendored
@ -31,6 +31,10 @@ export const videoProps = {
|
||||
type: String,
|
||||
value: 'back',
|
||||
},
|
||||
referrerPolicy: {
|
||||
type: String,
|
||||
value: 'no-referrer',
|
||||
},
|
||||
};
|
||||
// props for media
|
||||
export const mediaProps = {
|
||||
|
@ -42,7 +42,7 @@
|
||||
"condition": false
|
||||
},
|
||||
"compileType": "miniprogram",
|
||||
"libVersion": "2.6.5",
|
||||
"libVersion": "2.27.3",
|
||||
"appid": "wx1c01b35002d3ba14",
|
||||
"projectname": "vant-weapp",
|
||||
"condition": {
|
||||
|
@ -161,6 +161,7 @@ var defaultFieldNames = {
|
||||
selected: null,
|
||||
},
|
||||
],
|
||||
activeTab: 0,
|
||||
});
|
||||
},
|
||||
onClose: function () {
|
||||
|
1
lib/definitions/index.d.ts
vendored
1
lib/definitions/index.d.ts
vendored
@ -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;
|
||||
|
@ -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 });
|
||||
@ -133,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 () { },
|
||||
},
|
||||
|
@ -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,
|
||||
|
@ -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();
|
||||
},
|
||||
},
|
||||
});
|
||||
|
@ -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,
|
||||
|
@ -29,6 +29,7 @@
|
||||
poster="{{ item.thumb }}"
|
||||
autoplay="{{ item.autoplay }}"
|
||||
object-fit="{{videoFit}}"
|
||||
referrer-policy="{{videoReferrerPolicy}}"
|
||||
class="van-uploader__preview-image"
|
||||
style="{{ computed.sizeStyle({ previewSize }) }}"
|
||||
data-index="{{ index }}"
|
||||
|
4
lib/uploader/shared.d.ts
vendored
4
lib/uploader/shared.d.ts
vendored
@ -29,6 +29,10 @@ export declare const videoProps: {
|
||||
type: StringConstructor;
|
||||
value: string;
|
||||
};
|
||||
referrerPolicy: {
|
||||
type: StringConstructor;
|
||||
value: string;
|
||||
};
|
||||
};
|
||||
export declare const mediaProps: {
|
||||
capture: {
|
||||
|
@ -34,6 +34,10 @@ exports.videoProps = {
|
||||
type: String,
|
||||
value: 'back',
|
||||
},
|
||||
referrerPolicy: {
|
||||
type: String,
|
||||
value: 'no-referrer',
|
||||
},
|
||||
};
|
||||
// props for media
|
||||
exports.mediaProps = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user