06-Vue报错Failed to execute 'setAttribute' on 'Element': '{{count}}' is not a valid attribute name.

找了半天错误最后发现{{count}}放到了div里面
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script src="vue.js"></script>
</head>
<body>
<div id="app">
<my-component :init-count="1"></my-component>
</div>
<script>
Vue.component("my-component",{
props:["initCount"],
template:`<div{{count}}></div>`,
data(){
return{
count:this.initCount
}
}
});
new Vue({
el:"#app",
})
</script>
</body>
</html>
posted @ 2019-06-24 15:58  池鱼奥耶  阅读(5573)  评论(0编辑  收藏  举报