types: improve relation types (#9016)

This commit is contained in:
neverland
2021-07-12 20:54:19 +08:00
committed by GitHub
parent aedb8543e6
commit 0e05d8c908
28 changed files with 146 additions and 108 deletions
+4 -5
View File
@@ -3,6 +3,7 @@ import {
Ref,
computed,
PropType,
InjectionKey,
CSSProperties,
defineComponent,
ExtractPropTypes,
@@ -22,8 +23,6 @@ import {
const [name, bem] = createNamespace('dropdown-menu');
export const DROPDOWN_KEY = Symbol(name);
export type DropdownMenuDirection = 'up' | 'down';
const props = {
@@ -47,6 +46,8 @@ export type DropdownMenuProvide = {
offset: Ref<number>;
};
export const DROPDOWN_KEY: InjectionKey<DropdownMenuProvide> = Symbol(name);
export default defineComponent({
name,
@@ -57,9 +58,7 @@ export default defineComponent({
const barRef = ref<HTMLElement>();
const offset = ref(0);
const { children, linkChildren } = useChildren<ComponentInstance>(
DROPDOWN_KEY
);
const { children, linkChildren } = useChildren(DROPDOWN_KEY);
const scrollParent = useScrollParent(root);
const opened = computed(() =>