LoginSignup
2
1

More than 1 year has passed since last update.

Vue.js3.0移行(is属性を使ったカスタム要素)

Last updated at Posted at 2020-07-12

Vue.js 2.x の is 属性を使ったカスタム要素の移行

is 属性を使っている箇所を v-is に置き換えます。
※Vue.js 3.1で v-is は非推奨になっていて、代替構文は is="vue:xxx" です。
https://github.com/vuejs/vue-next/blob/master/CHANGELOG.md#310-2021-06-07
https://github.com/vuejs/vue-next/commit/af9e6999e1779f56b5cf827b97310d8e4e1fe5ec

Vue.js 2.x

<tbody>
  <tr is="my-component" v-for="(foo, index) in bar" :baz="foo" :key="index">
</tbody>

components: {
  'my-component': myComponent
},

Vue.js 3.x

<tbody>
  <tr v-is="'my-component'" v-for="(foo, index) in bar" :baz="foo" :key="index">
</tbody>

※componentオプションを使ってコンポーネントを登録した場合
コンポーネントの登録方法によって、記述方法が変わることに注意。
詳細はRFC参照。
https://github.com/vuejs/rfcs/pull/149

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1