-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
v-model value uses square bracket syntax with double quotes in <template lang="pug"> doesn't work since 3.2.13 version #5147
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
Comments
This is actually because of how pug transforms the expression you give to it: div
div(:title='row["item2"]') {{ row["item2"] }}
input(v-model='row["item2"]') becomes <div>
<div :title="row["item2"]">{{ row["item2"] }}</div><input v-model="row["item2"]" />
</div> |
@posva Thanks for your reply, I forgot to describe the four examples written in my code:
Among them, div
//- 2.1, ok
div(:title='row["item2"]') {{ row["item2"] }}
//- 2.2, error
input(v-model='row["item2"]') All four are working fine in |
I found that my steps to reproduce cannot be reproduced normally because of the cache. The first build will report an error, and the second build will not report an error. I updated the steps to reproduce:
|
@posva Because of the problem of troubleshooting and time, I did not have time to point out:
I updated the issue title: - When using square brackets to access objects, the value of v-model cannot be "Single quotes outside, double quotes inside"
+ v-model value is a special syntax in <template lang="pug"> doesn't work since 3.2.13 version And added steps to reproduce, see "Steps to reproduce" |
What you have is a pug syntax issue. It works fine when written in HTML as shown on the SFC. I'm not a pug expert, but you can just write |
谢谢你的建议,我们知道: 在
// ...
<script>
export default {
data() {
return {
row: { "item-3": "item-3 value", },
};
},
};
</script> 但是:
Thank you for your suggestion, we know: In
// ...
<script>
export default {
data() {
return {
row: { "item-3": "item-3 value", },
};
},
};
</script> but:
|
Version
3.2.26
Reproduction link
github.com
Steps to reproduce
Edititem2
insrc/components/Case1.vue
, then save the changes.input(v-model='row["item2"]')
insrc/components/Case1.vue
, then save the changes.Use
[email protected]
(has error)node_modules
folder.5147/use-vue-3.2.13-version
branch.Use
[email protected]
(ok)node_modules
folder.5147/use-vue-3.2.12-version
branch.What is expected?
Compiled Successfully.
What is actually happening?
Because i have some Chinese object property names.At first I thought that the value of v-model does not support Chinese, but it is notMy project works fine on
[email protected]
.The text was updated successfully, but these errors were encountered: