You are running Vue in development mode.
Make sure to turn on production mode when deploying for production.
See more tips at https://vuejs.org/guide/deployment.html
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
</head>
<body>
<div id="app">
</div>
<h3>{{msg}}</h3>
<script>
const app = new Vue({
el: '#app',
data: {
msg: "Hello World!"
}
})
</script>
</body>
</html>
解决方案:将所有的组件放在#app的div组件内!
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
</head>
<body>
<div id="app">
<h3>{{msg}}</h3>
</div>
<script>
const app = new Vue({
el: '#app',
data: {
msg: "Hello World!"
}
})
</script>
</body>
</html>
完美运行成功!