Vue.js `vue cli服务生成`不生成模板';s代码

Vue.js `vue cli服务生成`不生成模板';s代码,vue.js,vuejs2,Vue.js,Vuejs2,我试图理解为什么我在屏幕上看不到Vue项目中的任何内容。我查看了Vue CLI生成的项目,并在main.js中看到了这段代码: newvue({ 渲染:h=>h(应用程序), }).$mount(“#appmodified”) 但我使用以下代码,基于 newvue({ el:“#appmodified”, 模板:“”, 组件:{App} }) 当我运行npm run build时,这种实例化Vue的方法不会返回任何警告或错误: > @ build C:\wamp64\www\vuewt

我试图理解为什么我在屏幕上看不到Vue项目中的任何内容。我查看了Vue CLI生成的项目,并在
main.js
中看到了这段代码:

newvue({
渲染:h=>h(应用程序),
}).$mount(“#appmodified”)
但我使用以下代码,基于

newvue({
el:“#appmodified”,
模板:“”,
组件:{App}
})
当我运行
npm run build
时,这种实例化Vue的方法不会返回任何警告或错误:

> @ build C:\wamp64\www\vuewtest
> vue-cli-service build


\  Building for production...

 DONE  Compiled successfully in 1858ms                                                                                        13:14:40

  File                                 Size               Gzipped

  dist\js\chunk-vendors.6018a262.js    65.29 KiB          23.49 KiB
  dist\js\index.377fe308.js            1.96 KiB           1.01 KiB

  Images and other types of assets omitted.

 DONE  Build complete. The dist directory is ready to be deployed.
 INFO  Check out deployment instructions at https://cli.vuejs.org/guide/deployment.html
为什么我的代码在浏览器中没有显示任何内容,尽管构建完成时没有出现错误

main.js

从“Vue”导入Vue
从“./App”导入应用程序
Vue.config.productionTip=false
/*eslint禁用无新*/
//************这很有效************
新Vue({
渲染:h=>h(应用程序),
}).$mount(“#appmodified”)
//************这行不通*************
新Vue({
el:“#appmodified”,
模板:“”,
组件:{App}
})
vue.config.js

module.exports={
“公共路径”:“,
页码:{
索引:{
条目:“main.js”,
模板:“index.html”
}
}
}
package.json

{
  "scripts": {
    "serve": "vue-cli-service serve",
    "build": "vue-cli-service build"
  },
  "dependencies": {
    "@vue/cli-service": "^3.9.2",
    "vue": "^2.6.10",
    "vue-template-compiler": "^2.6.10"
  }
}

虽然在生成时可能看不到错误/警告,但仍应在浏览器控制台中看到运行时警告:

[Vue warn]:在模板编译器不可用的情况下,您正在使用仅运行时版本的Vue。可以将模板预编译为呈现函数,也可以使用编译器附带的构建

默认情况下,Vue CLI项目不包括运行时编译器,该编译器需要在运行时编译字符串模板或在DOM HTML中编译(请参阅)。如果您希望使用组件的
模板
属性,请使用以下配置Vue:

//vue.config.js
module.exports={
运行时编译器:true
}