Skip to content

ref in template typescript error? #1003

Answered by xiaoxiangmoe
lovetingyuan asked this question in Q&A
Discussion options

You must be logged in to vote

Can you provide a minimal reproducible demo?


Maybe the Ref<T> type of formData and the Ref<T> type from vue is not same.

Try this:

import {type Ref} from 'vue'
// ...
const formData2: Ref<{[x:string]: any}> = formData;

If type is not same, this will throw error.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@lovetingyuan
Comment options

Answer selected by lovetingyuan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants