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 -6
View File
@@ -6,6 +6,7 @@ import {
PropType,
Teleport,
onMounted,
InjectionKey,
CSSProperties,
TeleportProps,
defineComponent,
@@ -22,7 +23,6 @@ import {
createNamespace,
getRootScrollTop,
setRootScrollTop,
ComponentInstance,
} from '../utils';
// Composables
@@ -46,8 +46,6 @@ function genAlphabet() {
const [name, bem] = createNamespace('index-bar');
export const INDEX_BAR_KEY = Symbol(name);
const props = {
sticky: truthProp,
zIndex: [Number, String],
@@ -67,6 +65,8 @@ export type IndexBarProvide = {
props: ExtractPropTypes<typeof props>;
};
export const INDEX_BAR_KEY: InjectionKey<IndexBarProvide> = Symbol(name);
export default defineComponent({
name,
@@ -80,9 +80,7 @@ export default defineComponent({
const touch = useTouch();
const scrollParent = useScrollParent(root);
const { children, linkChildren } = useChildren<ComponentInstance>(
INDEX_BAR_KEY
);
const { children, linkChildren } = useChildren(INDEX_BAR_KEY);
linkChildren({ props });