比如我写的如下代码
Vue.component(‘chart-option’, {
template: <ul class="clearfix fl chart-option-list"> <li class="fl chart-option-item" v-for="(item, index) in checkedConfig"> <input class="hide" type="checkbox" :id="item.id" value="item.value" v-model="item.model" true-value="yes" false-value="no"> <label :for="item.id"> <span class="chart-option" :class="{on: item.model==='yes'}"> <i v-if="item.model==='yes'">√</i> </span> {{item.text}} </label> </li> </ul>
,
props: [‘checked-config’],
data() {
return {};
},
methods: {},
mounted() {}
});
我希望可以通过gulp把这个js代码转译,特别是template中的html转译成render函数。求教该怎么做?