访问后f12打开控制台,看看有没有报语法错误,然后根据错误定位问题
用F12审查一下元素
是不是单引号错了
template:`<h1>这里是首页</h1>`
也可以用下面这种方式写下
<body>
<div id="app">
<template id="home">
<h1>这里是首页</h1>
</template>
</div>
</body>
<script>
var app = new Vue({
el:"#app",
template:"#home"
})
</script>
1、F12看下控制台,报什么错误
2、template冒号后面的内容试试反引号