Skip to content

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

Description

@cnx2016

比如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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions