[Vuejs]-Load html in vue.js component attribute

1๐Ÿ‘

โœ…

var Main = {
  data() {
    return {
      active: 0,
      certain_list: [
        {title: 'Title1'},
        {title: 'Title2'},
        {title: 'Title3'}
      ]
    };
  }
}
var Ctor = Vue.extend(Main)
new Ctor().$mount('#app')
@import url("//unpkg.com/element-ui@2.13.0/lib/theme-chalk/index.css");
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.17/vue.min.js"></script>
<script src="//unpkg.com/element-ui@2.13.0/lib/index.js"></script>

<div id="app">
  <el-steps :active="active" align-center>
    <el-step v-for="(el,idx) in certain_list" :key="idx">
      <el-input slot="title" v-model="el.title"></el-input>
    </el-step>
  </el-steps>
</div>

Override the title attribute by using a named slot.

๐Ÿ‘คsugars

Leave a comment