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