Skip to content

v-for different behavior in v1.0.18 from v1.0.20 #2573

@zigomir

Description

@zigomir

Vue.js version

1.0.20

Reproduction Link

1.0.20 http://codepen.io/zigomir/pen/ONgOLB

Steps to reproduce

Use v-if that references v-for variable before v-for in same element.

What is Expected?

I think v-for should work the same (v1.0.18 example http://codepen.io/zigomir/pen/GZEOKG
) since it's patch version bump and breaking changes aren't anticipated. This broke our production code when trying to upgrade vue. Although, how it's working now (1.0.20) makes more sense to me. Maybe it should just be mentioned in release notes and/or guides.

What is actually happening?

It doesn't work because now order matters. You need to update all v-for loops where variable is used before v-for is declared to make loop work.

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