[Vue warn]: You are using the runtime-only build of Vue where the templa
来源:互联网 发布:淘宝客那几个厉害 编辑:程序博客网 时间:2024/05/24 04:42
[Vue warn]: You are using the runtime-only build of Vue where the template compiler is not available. Either pre-compile the templates into render functions, or use the compiler-included build.(found in )
上述报错是发生在使用vue框架时,单纯的向Vue中绑定一个template,如下:
new Vue({ el: '#app', template:"<div>wret</div>" // router, // render: h => h(App)})
下面看大神的解答:
****************************************************************************************************************************************************************************
这是什么意思呢?
运行时构建不包含模板编译器,因此不支持 template 选项,只能用 render 选项,但即使使用运行时构建,在单文件组件中也依然可以写模板,因为单文件组件的模板会在构建时预编译为 render 函数。
上面一段是官方api中的解释。就是说,如果我们想使用template,我们不能直接在客户端使用npm install之后的vue。此时,再去看查vue模块,添加几行
resolve: {
alias: {
'vue': 'vue/dist/vue.js'
}
}
再运行,没错ok了。
作者: 外号理论汪
链接:http://www.imooc.com/article/17868
来源:慕课网
本文原创发布于慕课网 ,转载请注明出处,谢谢合作!
阅读全文
3 0
- [Vue warn]: You are using the runtime-only build of Vue where the templa
- webpack打包vue2.0,[Vue warn]: You are using the runtime-only build of Vue where the template compiler
- How the iPhone knows where you are
- christian louboutin outlet online Are you conscious of the particular space where you tin purchase p
- where are three concepts of the oop
- 113.You are working on a new Oracle Database 11g server, where only the software is installed and no
- You are attempting to build with the incorrect version of java.
- You are attempting to build with the incorrect version of java.
- You are attempting to build with the incorrect version of java
- You are attempting to build with the incorrect version of java.
- You are the apple of my eye.
- You are using version 6.4.1 of the AdMob SDK which is non-compliant with the Google Play Ad Policy
- There Are Only Four Jobs in the Whole World – Are You in the Right One?
- The only Peoplecode events you should be using
- You are not using the latest Platform SDK header/library
- ARE YOU USING THE RIGHT SQL SERVER PERFORMANCE METRICS?
- You Are the One
- the way you are
- Java Script 的面向对象编程
- Python_BeautifulSoup 抓取网页内容入门
- connect函数的理解
- rsync+inotify同步备份MYSQL数据
- mat flag成员
- [Vue warn]: You are using the runtime-only build of Vue where the templa
- 守护进程的创建过程
- 插件化
- SQLite语句——删除
- 经纬度和高程坐标转换,来自osg
- windows 不能在本地启动 apache 2.4
- Jprofiler远程连接linux项目监控
- Codeforces Round #418 (Div. 2) B. An express train to reveries
- springboot集成dubbo,dubbox分布式服务框架