首页 > 其他 > 详细

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

时间:2019-06-24 16:39:05      阅读:1096      评论:0      收藏:0      [点我收藏+]
找了半天错误最后发现{{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.

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!