我有以下的underscore.js模板,里面有vue.js。但是我注意到vue.js在underscore.js模板中混合时似乎不起作用。
<div id='my-container'></div>
<script id="my-template" type="text/template">
<th class="initial " v-bind:class="{'active': isActive}" v-on:click="dayFilter" >
<span class="wkday"><%= day %></span>
</th>
</script>
var clndr = $('#my-container').clndr({
template: $('#my-template').html()
});
new Vue({
el: '#my-container',
data: {
isActive: false
},
methods: {
dayFilter: function () {
this.isActive = ! this.isActive;
}
}
})