[Vue warn]: Do not mount Vue to <html> or <body> - mount to normal elements instead.
官方文档是这么解释的:
提供的元素只能作为挂载点。不同于 Vue 1.x,所有的挂载元素会被 Vue 生成的 DOM 替换。因此不推荐挂载root实例到 <html> 或者 <body> 上。
这是vue2.0的最新写法,我们看到的是vue项目的主入口main.js,template是将会替换el的挂载元素的模板
区别一定是:el对应的 一定是一个css选择器,如果还是html 或者body元素,浏览器将会报错:
[Vue warn]: Do not mount Vue to <html> or <body> - mount to normal elements instead.
[Vue warn]: Do not mount Vue to <html> or <body> - mount to normal elements instead.的更多相关文章
- "[Vue warn]: Failed to mount component: template or render function not defined"错误的解决
VUE中动态路由出错: vue.esm.js?a026: [Vue warn]: Failed to mount component: template or render function not ...
- [Vue warn]: Failed to mount component: template or render function not defined. 错误解决方法
解决方法import Vue from "vue"; 默认引入的文件是 vue/dist/vue.runtime.common.js.这个可以在node_modules/vue/p ...
- [Vue warn]: Error in render: "TypeError: Cannot read property '0' of undefined、vuejs路由使用的问题Error in render function
1.[Vue warn]: Error in render: "TypeError: Cannot read property '0' of undefined 注意,只要出现Error i ...
- 【js】vue 2.5.1 源码学习 (十) $mount 挂载函数的实现
大体思路(九) 本节内容: 1. $mount 挂载函数的实现. // 将Vue.prototype.$mount 缓存下来 ==>mountComponet(this,el) { // 组建挂 ...
- vue踩坑记录:[Vue warn]: $attrs is readonly.
今天在用element-ui的DatePicker日期选择器的时候,发现每当点击一次这个组件,控制台就会报警告`[Vue warn]: $attrs is readonly`,但是也不影响实际操作效果 ...
- vue.runtime.esm.js:593 [Vue warn]: Invalid prop: custom validator check failed for prop "value".报错解决
在uni中使用 picker组件,一直报错 vue.runtime.esm.js:593 [Vue warn]: Invalid prop: custom validator check failed ...
- [Vue warn]: Attribute "id" is ignored on component <div> because the component is a fragment instanc
今天在使用vue框架搭建环境时,遇到这个错误提示: [Vue warn]: Attribute "id" is ignored on component <div> b ...
- [Vue warn]: Cannot find element: #main
使用vue框架的时候,如果页面提示如下错误,则说明new Vue的时候没有传入 el 的值: [Vue warn]: Cannot find element: #main 我们传入el 既可以,如: ...
- [Vue warn]: Error in render: "SyntaxError: Unexpected token ' in JSON at position 1"
一,场景: 字符串转对象: var str = "{'bankRate':5,'YINGUO':0}" 二,操作: JSON.parse(str)时候,报错 [Vue warn]: ...
随机推荐
- 20172313『Java程序设计』课程结对编程练习_四则运算第二周阶段总结
20172313『Java程序设计』课程结对编程练习_四则运算第二周阶段总结 结对伙伴 20172326康皓越 博客地址(http://www.cnblogs.com/326477465-a/p/90 ...
- python learning1.py
# 廖雪峰的官方网站 python教材 1~4章 # 格式控制符语法 print('Hello, %s' % 'world') print('hello, %s, you have %d dollar ...
- 04_Java基础语法_第4天(数组)_讲义
今日内容介绍 1.流程控制语句switch 2.数组 3.随机点名器案例 01switch语句解构 * A:switch语句解构 * a:switch只能针对某个表达式的值作出判断,从而决定程序执行哪 ...
- NodeJs实现客户端登陆
nodejs的api中有一个process进程对象,process 对象是一个 global (全局变量),提供有关信息,控制当前 Node.js 进程.作为一个对象,它对于 Node.js 应用程序 ...
- Python入门:条件控制
条件控制其实就是if...else...(如果...条件是成立的,就做...:反之,就做...)的使用,其基本结构是: 具体看下面这个例子: def account_login(): # 定义函数 p ...
- oracle 简单的sysTimeStamp类型转date 类型
oracle 简单的SYSTIMESTAMP 类型转date 类型 SELECT SYSTIMESTAMP , SYSTIMESTAMP+0 FROM dual; SAMPLE_TIME ----- ...
- Android如何避免OOM总结
转自:https://blog.csdn.net/ljx19900116/article/details/50037627 前面介绍了一些基础的内存管理机制以及OOM的基础知识,那么在实践操作当中,有 ...
- php反射方法信息
<?phpclass ReflectionFunction implements Reflector{ final private __clone() public object _ ...
- Linux进程调度策略的发展和演变(转)
转发:http://blog.csdn.net/gatieme/article/details/51701149 1 前言 1.1 进程调度 内存中保存了对每个进程的唯一描述, 并通过若干结构与其他 ...
- Java override 和 overload 的区别和联系
方法的重写(Overriding)和重载(Overloading)是Java多态性的不同表现.重写(Overriding)是父类与子类之间多态性的一种表现,而重载(Overloading)是一个类中多 ...