浏览器报错,看了分析没有理解,报错内容如下:
代码如下:
<div id="app">
<counter heading="Likes" color="green"></counter>
<counter heading="Dislikes" color="red"></counter>
</div>
<template id="counter-template">
<div>
<h1>{{heading}}</h1>
//style的这种写法哪里出错了?
<button @click="count += 1" style="background:{{color}}">{{count}}</button>
</div>
</template>
<script src="js/vue.js"></script>
<script>
Vue.component('counter',{
template:"#counter-template",
props:['heading','color'],
data:function(){
return {count:0}
}
}
);
new Vue({
el:'#app'
})
请大神帮忙解答下,谢谢!!
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…