perf: add truthProp util (#8522)
* perf: add TruthyProp util * chore: rename * chore: upd
This commit is contained in:
+3
-9
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user