Help us understand the problem. What is going on with this article?

Vueのisとv-modelは併用してはいけない

事象

is属性で要素名を指定しているコンポーネントに対して、v-modelを使用すると、v-modelが機能しなくなりました。

どういうことかは例を見ていただくと早いです。

正常

<input type="text" v-model="value">

https://jsfiddle.net/simochee/fjdvowr7/4

異常

<div is="input" type="text" v-model="value">

https://jsfiddle.net/simochee/fjdvowr7/5

原因

なぜこんな挙動になるのか、それを解決する記述を見つけることはできませんでした。

ともかくisv-modelは併用しないよう気をつけましょう。

おまけ

疑似v-modelの場合は更に奇妙な挙動になりました。

初期値は設定されるし、入力値は設定できるものの、代入による値を上書きできなくなります。

<div
  is="input"
  type="text"
  :value="value"
  @input="value = $event.target.value"
>

https://jsfiddle.net/simochee/fjdvowr7/7/

Why do not you register as a user and use Qiita more conveniently?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away