-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
cannot watch unicode properties like 'a.中文' #8862
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
Next time take the time to add the repro (which I added) |
Use chinese as a key is nonstandard. We strongly recommend that use |
But in some cases, we still need to use Chinese characters as keys. Such as username key-value pairs. |
Though using Chinese as key is strange, as a framework/library, it must consider all edge cases. It's not related to best practices. |
Although I also think that characters other than the underscore of English data should not be used as attributes, sometimes the interface provided by the third party, in order to reduce the complexity of docking, will directly give the JSON format data whose attributes are named in Chinese. At the time of binding, there was trouble. |
I believe this should have been referenced as being closed by #8666 |
Indeed, this was added there and should be on 2.6 |
Version
2.5.17
Reproduction link
https://jsfiddle.net/k72f3Lon/
Steps to reproduce
1.webpack project with vue .
2.add a component .
3.create instance of Vue .
4.add a property
data:function(){return {a:{中文:"",b:""}}}
to the instance.5.add watch properties to the instance as
watch:{'a.b':function(val){},'a.中文':function(val){}}
6.console show error that Watcher only accepts simple dot-delimited paths.
What is expected?
no error the code run continue
What is actually happening?
the code seems stopped to run
The text was updated successfully, but these errors were encountered: