How type annotion for ref?
Closed this issue · 5 comments
gsxhnd commented
<Draggable
v-model="data"
ref="tree"
virtualization
>
</Draggable>
<script setup lang="ts">
const tree: Ref< ?|null> = ref(null);
phphe commented
ref<InstanceType<typeof Draggable>>()
gsxhnd commented
tree.value?.addMulti(f);
Here is error:
Property 'addMulti' does not exist on type 'CreateComponentPublicInstance<Readonly<ExtractPropTypes<{ triggerClass: { type: PropType<string | string[]>; }; disableDrag: BooleanConstructor; disableDrop: BooleanConstructor; ... 13 more ...; ondragstart: { ...; }; }>>, ... 18 more ..., { ...; } & { ...; }>'.ts-plugin(2339)
version: 2.8.3
phphe commented
try
import type {DraggableTreeType} from '@he-tree/vue'
...
let tree = ref<DraggableTreeType>();
gsxhnd commented
Same error
In DraggableTree.d.ts, not have addMulti or other method
phphe commented
fixed in 2.8.5