Skip to content

Attribute doesn't update if binded to a property called selected #4233

@hay

Description

@hay

If you have an element that is binded to an attribute called selected it won't update in the DOM. For example:

<p v-bind:selected="selected">selected is {{selected}}</p>
<button v-on:click="selected = !selected">toggle</button>

Note that the {{selected}} template works fine, and the variable updates as well. It's just the attribute that doesn't update.

Here's a codepen that reproduces the problem: http://codepen.io/hay/pen/mOOrWK

Problem occurs in Vue 2.0.7. This example works fine in 1.0.28.

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