Skip to content

[Question] v-models 的值怎么使用变量 #502

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
hsiangleev opened this issue Sep 13, 2021 · 2 comments
Closed

[Question] v-models 的值怎么使用变量 #502

hsiangleev opened this issue Sep 13, 2021 · 2 comments
Labels
question Further information is requested

Comments

@hsiangleev
Copy link

请问v-models的值怎么使用变量,models的值由多个变量组合,例如

const name = ref('')
const age = ref(0)
const models = []
models.push([name.value, 'name'])
models.push([age.value, 'age', ['number']])
return () => (
    <Test v-models={models} />
)

我这样使用会报错Internal server error: unknown: Property key of ObjectProperty expected node to be of a type ["Identifier","StringLiteral","NumericLiteral"] but instead got undefined

@hsiangleev hsiangleev added the question Further information is requested label Sep 13, 2021
@Amour1688
Copy link
Member

v-models 暂时不支持变量。等 #496 被合入,会逐渐废弃 v-models 的写法

@hsiangleev
Copy link
Author

@Amour1688 那合并之后的新写法会支持使用变量吗

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants