perf: add truthProp util (#8522)

* perf: add TruthyProp util

* chore: rename

* chore: upd
This commit is contained in:
neverland
2021-04-14 10:26:21 +08:00
committed by GitHub
parent 9381640d2e
commit bd609e1df0
59 changed files with 226 additions and 460 deletions
+3 -9
View File
@@ -1,5 +1,5 @@
import { PropType, defineComponent, ExtractPropTypes } from 'vue';
import { createNamespace, addUnit } from '../utils';
import { createNamespace, addUnit, truthProp } from '../utils';
import { BORDER_TOP } from '../utils/constant';
import { useChildren } from '@vant/use';
@@ -11,6 +11,8 @@ export type GridDirection = 'horizontal' | 'vertical';
const props = {
square: Boolean,
center: truthProp,
border: truthProp,
gutter: [Number, String],
iconSize: [Number, String],
direction: String as PropType<GridDirection>,
@@ -19,14 +21,6 @@ const props = {
type: [Number, String],
default: 4,
},
center: {
type: Boolean,
default: true,
},
border: {
type: Boolean,
default: true,
},
};
export type GridProvide = {