Skip to content
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

对象如果包含数组,遍历可能出现问题, v.$key()报错。 #75

Open
cnx2016 opened this issue Apr 21, 2016 · 1 comment
Open

Comments

@cnx2016
Copy link

cnx2016 commented Apr 21, 2016

比如VM的data包含一个属性list1,是个数组,那么用this.$set方法给list赋值新的数组后,q-repeat遍历不会有问题。
但如果data包含一个属性list2,是个对象,对象内又包含一个属性children,为数组,用q-repeat去遍历list2.children。然后用this.$set方法给list2赋值一个新的对象,新对象的children数组长度发生变动,则q-repeat会出现问题。

例子代码参见附件。
test_array_set.html.txt

@miniflycn
Copy link
Member

以前没提供点操作所以没出现问题,这个要想想怎么整。

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

No branches or pull requests

2 participants