types: improve relation types (#9016)
This commit is contained in:
+11
-5
@@ -1,17 +1,23 @@
|
||||
import { computed, PropType, ComputedRef, defineComponent } from 'vue';
|
||||
import { truthProp, createNamespace, ComponentInstance } from '../utils';
|
||||
import {
|
||||
computed,
|
||||
PropType,
|
||||
ComputedRef,
|
||||
InjectionKey,
|
||||
defineComponent,
|
||||
} from 'vue';
|
||||
import { truthProp, createNamespace } from '../utils';
|
||||
import { useChildren } from '@vant/use';
|
||||
|
||||
const [name, bem] = createNamespace('row');
|
||||
|
||||
export const ROW_KEY = Symbol(name);
|
||||
|
||||
export type RowSpaces = { left?: number; right: number }[];
|
||||
|
||||
export type RowProvide = {
|
||||
spaces: ComputedRef<RowSpaces>;
|
||||
};
|
||||
|
||||
export const ROW_KEY: InjectionKey<RowProvide> = Symbol(name);
|
||||
|
||||
export type RowAlign = 'top' | 'center' | 'bottom';
|
||||
|
||||
export type RowJustify =
|
||||
@@ -39,7 +45,7 @@ export default defineComponent({
|
||||
},
|
||||
|
||||
setup(props, { slots }) {
|
||||
const { children, linkChildren } = useChildren<ComponentInstance>(ROW_KEY);
|
||||
const { children, linkChildren } = useChildren(ROW_KEY);
|
||||
|
||||
const groups = computed(() => {
|
||||
const groups: number[][] = [[]];
|
||||
|
||||
Reference in New Issue
Block a user