Skip to content

Disabling warnings about inline value attributes for v-model on select #5112

Closed
@oliverpool

Description

@oliverpool

Vue.js version

2.2.0

Reproduction Link

http://jsfiddle.net/wdgfnn0h/3/

Steps to reproduce

Create a <select v-model="value"> tag with a selected option: <option selected>Value</option>.

What is Expected?

I expect not warning because in my app, I initialize the Vue values with the values extracted from the HTML (to keep a no-js compatibility).
This has been discussed in #4733 and implemented in #4770

What is actually happening?

A warning is shown in the console:

[Vue warn]: Error compiling template:

<div id="app">
<select v-model="first">
<option value="0">option0</option>
<option value="1" selected="">option1</option>
</select>
</div>
  • <select v-model="first">:
    inline selected attributes on will be ignored when using v-model. Declare initial values in the component's data option instead.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions