Subscribe on changes!

v-model value must be a valid JavaScript member expression

avatar
Jun 5th 2021

Version

3.1.0-beta.7

Reproduction link

https://github.com/RyzenPan/vue3-element-plus-vite

Steps to reproduce

I set a v-model value is v-model="data[item.dataIndex[0]]"

data = { startTime: '' } item.dataIndex[0] = 'startTime'

item.dataIndex[0] is String

but the console thorw error v-model value must be a valid JavaScript member expression

What is expected?

It is not error

What is actually happening?

v-model value must be a valid JavaScript member expression

avatar
Jun 5th 2021

the linked "reproduction" does not contain the code mentioned in the description.

Please open a new issue with a real reproduction.

avatar
Jun 6th 2021

make sure update @vue/complier-sfc to 3.1.0-beta.7. It will work.

avatar
Jun 8th 2021

Hi, i got the same error since @vue/compiler-sfc 3.1.1. It works fine with 3.0.11

VueCompilerError: v-model value must be a valid JavaScript member expression.

v-model="selectedFilters[index][value]"
avatar
Jun 8th 2021

Same here, I got the same error on @vue/compiler-sfc 3.1.0 and 3.1.1

VueCompilerError: v-model value must be a valid JavaScript member expression.
v-model="translations['zh-CN'][propName]"
avatar
Jun 8th 2021

Posting "same here" on a closed issue without providing a reproduction won't help us to solve this.

please open a new issue and provide a real reproduction