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
feat: support symbols as keys in observed objects #10741
base: dev
Are you sure you want to change the base?
Conversation
Fixed when the key of the object is of symbol type, it does not work.
feat: support symbols as keys in observed objects fix vuejs#10741[, vuejs#10741]
Take care about methods like |
Symbols are not currently supported by Flow。Reflect.ownkeys returns all the properties on the object, including those that cannot be enumerated. On the other hand, if there is an enumerable "__ob__" attribute on the responsive object, the stack will overflow. yes, ensure that this feature will work properly everywhere, those places also need to be dealt with. |
你的意思是, vue2在对data中的对象进行响应式处理的时候, 并不会处理key为symbol的属性. 但是用$set可以解决这个问题
|
还是vue3牛逼啊, 虽然我用$set可以让一个对象中symbol类型的key响应, 但是如果data里面定义的是一个数组, 数组的元素是对象, 对象有symbol类型的key呢, 又该怎么办
|
What kind of change does this PR introduce? (check at least one)
Does this PR introduce a breaking change? (check one)
If yes, please describe the impact and migration path for existing applications:
The PR fulfills these requirements:
dev
branch for v2.x (or to a previous version branch), not themaster
branchfix #xxx[,#xxx]
, where "xxx" is the issue number)If adding a new feature, the PR's description includes:
Other information: