types(Grid): use tsx (#8122)

This commit is contained in:
neverland
2021-02-10 20:21:08 +08:00
committed by GitHub
parent 692631968d
commit 5b352d0339
2 changed files with 31 additions and 8 deletions
+17 -1
View File
@@ -1,3 +1,4 @@
import { PropType } from 'vue';
import { createNamespace, addUnit } from '../utils';
import { BORDER_TOP } from '../utils/constant';
import { useChildren } from '@vant/use';
@@ -6,12 +7,27 @@ const [createComponent, bem] = createNamespace('grid');
export const GRID_KEY = 'vanGrid';
export type GridDirection = 'horizontal' | 'vertical';
export type GridProvide = {
props: {
center: boolean;
border: boolean;
square?: boolean;
gutter?: number | string;
iconSize?: number | string;
columnNum: number | string;
direction?: GridDirection;
clickable?: boolean;
};
};
export default createComponent({
props: {
square: Boolean,
gutter: [Number, String],
iconSize: [Number, String],
direction: String,
direction: String as PropType<GridDirection>,
clickable: Boolean,
columnNum: {
type: [Number, String],