refactor(VantComponent): remove null type (#4476)

This commit is contained in:
nemo-shen 2021-09-10 11:06:32 +08:00 committed by GitHub
parent 687c7c10f9
commit e2e0a2bcb1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 30 additions and 16 deletions

View File

@ -27,7 +27,8 @@ VantComponent({
observer: 'setValues', observer: 'setValues',
}, },
columnsNum: { columnsNum: {
type: null, type: Number,
optionalTypes: [String],
value: 3, value: 3,
}, },
columnsPlaceholder: { columnsPlaceholder: {

View File

@ -31,7 +31,8 @@ VantComponent({
value: 'round', value: 'round',
}, },
iconSize: { iconSize: {
type: null, type: Number,
optionalTypes: [String],
value: 20, value: 20,
}, },
}, },

View File

@ -41,7 +41,8 @@ VantComponent({
value: WHITE, value: WHITE,
}, },
color: { color: {
type: null, type: String,
optionalTypes: [Object],
value: BLUE, value: BLUE,
observer() { observer() {
this.setHoverColor().then(() => { this.setHoverColor().then(() => {

View File

@ -10,7 +10,8 @@ VantComponent({
observer: 'updateChildren', observer: 'updateChildren',
}, },
gutter: { gutter: {
type: null, type: Number,
optionalTypes: [String],
value: 0, value: 0,
observer: 'updateChildren', observer: 'updateChildren',
}, },

View File

@ -5,7 +5,8 @@ VantComponent({
show: Boolean, show: Boolean,
customStyle: String, customStyle: String,
duration: { duration: {
type: null, type: Number,
optionalTypes: [String],
value: 300, value: 300,
}, },
zIndex: { zIndex: {

View File

@ -27,7 +27,8 @@ VantComponent({
value: 'round', value: 'round',
}, },
iconSize: { iconSize: {
type: null, type: Number,
optionalTypes: [String],
value: 20, value: 20,
}, },
}, },

View File

@ -34,7 +34,8 @@ VantComponent({
value: true, value: true,
}, },
duration: { duration: {
type: null, type: Number,
optionalTypes: [String],
value: 300, value: 300,
}, },
}, },

View File

@ -33,9 +33,10 @@ VantComponent({
value: '40%', value: '40%',
}, },
rowWidth: { rowWidth: {
type: null, type: String,
optionalTypes: [Array],
value: '100%', value: '100%',
observer(val) { observer(val: string | string[]) {
this.setData({ isArray: val instanceof Array }); this.setData({ isArray: val instanceof Array });
}, },
}, },

View File

@ -28,7 +28,8 @@ VantComponent({
}, },
asyncClose: Boolean, asyncClose: Boolean,
name: { name: {
type: null, type: String,
optionalTypes: [Number],
value: '', value: '',
}, },
}, },

View File

@ -37,12 +37,14 @@ VantComponent({
}, },
}, },
lineWidth: { lineWidth: {
type: null, type: Number,
optionalTypes: [String],
value: 40, value: 40,
observer: 'resize', observer: 'resize',
}, },
lineHeight: { lineHeight: {
type: null, type: Number,
optionalTypes: [String],
value: -1, value: -1,
}, },
active: { active: {
@ -98,7 +100,7 @@ VantComponent({
scrollLeft: 0, scrollLeft: 0,
scrollable: false, scrollable: false,
currentIndex: 0, currentIndex: 0,
container: null as unknown as () => WechatMiniprogram.NodesRef, container: (null as unknown) as () => WechatMiniprogram.NodesRef,
skipTransition: true, skipTransition: true,
scrollWithAnimation: false, scrollWithAnimation: false,
lineOffsetLeft: 0, lineOffsetLeft: 0,

View File

@ -22,7 +22,8 @@ VantComponent({
observer: 'updateSubItems', observer: 'updateSubItems',
}, },
height: { height: {
type: null, type: Number,
optionalTypes: [String],
value: 300, value: 300,
}, },
max: { max: {

View File

@ -12,11 +12,13 @@ VantComponent({
afterRead: null, afterRead: null,
beforeRead: null, beforeRead: null,
previewSize: { previewSize: {
type: null, type: Number,
optionalTypes: [String],
value: 80, value: 80,
}, },
name: { name: {
type: null, type: String,
optionalTypes: [Number],
value: '', value: '',
}, },
accept: { accept: {