码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2019-06-24 16:34:17      阅读:228      评论:0      收藏:0      [点我收藏+]

标签:doctype   div   component   failed   return   data   led   ret   new   

找了半天错误最后发现{{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>

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

标签:doctype   div   component   failed   return   data   led   ret   new   

原文地址:https://www.cnblogs.com/Romantic-Blood/p/11077591.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!