使用template.html,页面打开后写在head里面的内容变到body里面去了
来源:3-1 一点小准备-单独讲解vue核心内容的配置

Junble
2021-03-29
config里面这样配置
new HTMLPlugin({
template: path.join(__dirname,'template.html')
})
template.html内容
<!DOCTYPE html>
<html lang="en">
<head>
<mate charset="UTF-8"></mate>
<mate name="viewport" content="width=device-width, initial-scale=1.0"></mate>
<mate http-equiv="X-UA-Compatible" content="ie=edge"></mate>
<title>Document</title>
</head>
<body>
<div id="root"></div>
</body>
</html>
index.js
import Vue from 'vue'
new Vue({
el: '#root',
template: '<div> this is content</div>'
})
页面打开后写在head里面的内容变到body里面去了,是什么原因
写回答
1回答
-
你看一下chrome调试工具的network模块,看看返回的HTML是什么内容
072021-04-20
相似问题