File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ export function lifecycleMixin (Vue: Class<Component>) {
44
44
vm . $options . render = emptyVNode
45
45
if ( process . env . NODE_ENV !== 'production' ) {
46
46
/* istanbul ignore if */
47
- if ( vm . $options . template ) {
47
+ if ( vm . $options . template && vm . $options . template . charAt ( 0 ) !== '#' ) {
48
48
warn (
49
49
'You are using the runtime-only build of Vue where the template ' +
50
50
'option is not available. Either pre-compile the templates into ' +
Original file line number Diff line number Diff line change @@ -34,6 +34,13 @@ Vue.prototype.$mount = function (
34
34
if ( typeof template === 'string' ) {
35
35
if ( template . charAt ( 0 ) === '#' ) {
36
36
template = idToTemplate ( template )
37
+ /* istanbul ignore if */
38
+ if ( process . env . NODE_ENV !== 'production' && ! template ) {
39
+ warn (
40
+ `Template element not found or is empty: ${ options . template } ` ,
41
+ this
42
+ )
43
+ }
37
44
}
38
45
} else if ( template . nodeType ) {
39
46
template = template . innerHTML
You can’t perform that action at this time.
0 commit comments