Skip to content

Commit

Permalink
chore: up test
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiyuanzmj committed Aug 30, 2024
1 parent 75ab7fc commit f9ece30
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
declare module 'vue' {
export interface GlobalComponents {
Generic: typeof import('./generic.vue')['default'];
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
<script setup lang="ts">
import { useTemplateRef } from 'vue';
import Generic from './generic.vue';
import { exactType } from '../../shared';
const comp1 = useTemplateRef('generic');
if (comp1.value) exactType(comp1.value.foo, 1);
const comp2 = useTemplateRef('v-for');
if (comp2.value) exactType(comp2.value[0]?.foo, {} as number | undefined);
Expand All @@ -15,6 +13,8 @@ if (comp3.value) exactType(comp3.value?.href, {} as string | undefined);

<template>
<Generic ref="generic" :foo="1"></Generic>

{{ exactType(comp1.foo, 1) }}

<Generic v-for="i in 4" ref="v-for" :foo="i"></Generic>

Expand Down

0 comments on commit f9ece30

Please sign in to comment.