Skip to content

Directives break when replacing an item in array using splice #3848

@samgre

Description

@samgre

Vue.js version

2.0.1

Reproduction Link

http://jsfiddle.net/5sH6A/723/

Steps to Reproduce

Click "remove" next to "2".

Expected Result

The page should've rendered without Vue.js throwing an error.

More Info

I'm working on a small app, which has a two-level hierarchy of items. If an item contains subitems, it is rendered as a group and the contained items are rendered recursively. Thus, a group and an item result into different HTML being rendered (and different directives in the elements).

Now, if I replace a group with an item using splice, the virtual dom doesn't notice that the HTML element changed (with its directives), but tries to update the items directives with group's.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions