Skip to content

v-once for component tag doesn't work in v-for #8021

Open
@hydroDude

Description

@hydroDude

Version

2.5.16

Reproduction link

https://jsfiddle.net/hL0rrbs9/6/

Steps to reproduce

Run code, and watch.

What is expected?

"Yay Yay ;)" values should not change to "hell naw!" in 3 seconds.

What is actually happening?

"Yay Yay ;)" values are changing in to "hell naw!" in 3 seconds.


Wait 3 seconds. Behavior is not consistent. "component" tag in v-for should not change.

{{comp}}

{{comp}}

<script> var z = new Vue({ el: "#app", data: { comp: "comp1", items: [{id:1}, {id:2}] }, components: { "comp1": { template: "

yay yay ;)

" }, "comp2": { template: "

hell naw!

" } } });

setTimeout(function() {
z.comp = "comp2"
}, 3000);
</script>

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