在新项目中,我的应用在 expressJs 服务器上找不到带有 VueJS (2.5.13) 的根元素。
我的 index.html:
<html>
<head>
<title>Test</title>
</head>
<body>
<div id="app"></div>
<script src="dist/index.js"></script>
</body>
</html>
我的 js 入口点:
import Vue from 'vue'
import App from './App'
new Vue({
render: h => h(App)
}).$mount('#app')
还有我非常基础的 App.vue:
<template>
<div>
Hello the world
</div>
</template>
<script>
export default {
name: 'app'
}
</script>
<style>
</style>
我使用 babel-loader 和 webpack。我不明白为什么 Vue 找不到#app
id。
谢谢你的帮助