mirror of https://github.com/vuejs/vue.git
				
				
				
			prohibit mounting to body/html
This commit is contained in:
		
							parent
							
								
									fc78242a07
								
							
						
					
					
						commit
						16ce0f13d5
					
				|  | @ -16,6 +16,14 @@ Vue.prototype.$mount = function ( | |||
|   hydrating?: boolean | ||||
| ): Component { | ||||
|   el = el && query(el) | ||||
| 
 | ||||
|   if (el === document.body || el === document.documentElement) { | ||||
|     process.env.NODE_ENV !== 'production' && warn( | ||||
|       `Do not mount Vue to <html> or <body> - mount to normal elements instead.` | ||||
|     ) | ||||
|     return this | ||||
|   } | ||||
| 
 | ||||
|   const options = this.$options | ||||
|   // resolve template/el and convert to render function
 | ||||
|   if (!options.render) { | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue