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
@@ -6,6 +6,7 @@ import {
onMounted,
ComputedRef,
onActivated,
InjectionKey,
CSSProperties,
onDeactivated,
onBeforeUnmount,
@@ -20,7 +21,6 @@ import {
truthProp,
preventDefault,
createNamespace,
ComponentInstance,
} from '../utils';
// Composables
@@ -36,8 +36,6 @@ import { onPopupReopen } from '../composables/on-popup-reopen';
const [name, bem] = createNamespace('swipe');
export const SWIPE_KEY = Symbol(name);
const props = {
loop: truthProp,
width: [Number, String],
@@ -73,6 +71,8 @@ export type SwipeProvide = {
activeIndicator: ComputedRef<number>;
};
export const SWIPE_KEY: InjectionKey<SwipeProvide> = Symbol(name);
export default defineComponent({
name,
@@ -93,8 +93,7 @@ export default defineComponent({
const touch = useTouch();
const windowSize = useWindowSize();
const { children, linkChildren } =
useChildren<ComponentInstance>(SWIPE_KEY);
const { children, linkChildren } = useChildren(SWIPE_KEY);
const count = computed(() => children.length);