1
1

More than 1 year has passed since last update.

Vue.js HTMLの属性(attribute)の中で文字列内変数展開をする

Posted at

ES2015(ES6)の`(バッククォート)を使った展開方法が使える

new Vue({
    el: .app
    data: { key: 'sample' }
})
<div class=".app">
  <input type="text" name="`array[${key}]`">
</div>

IEはこのTemplate literals (Template strings)を対応してない。

参考

1
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
1
1