types(@vant/use): relation key can be symbol

This commit is contained in:
chenjiahan
2020-10-05 10:26:44 +08:00
parent 32697cafad
commit 90e82c277e
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -59,7 +59,7 @@ export function sortChildren(
});
}
export function useChildren(key: string) {
export function useChildren(key: string | symbol) {
const publicChildren: PublicInstance[] = reactive([]);
const internalChildren: InternalInstance[] = reactive([]);
const parent = getCurrentInstance()!;
@@ -101,7 +101,7 @@ type ParentProvide<T> = T & {
internalChildren: InternalInstance[];
};
export function useParent<T>(key: string) {
export function useParent<T>(key: string | symbol) {
const parent = inject<ParentProvide<T> | null>(key, null);
if (parent) {