File tree Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -18,12 +18,20 @@ const normalizeAsync = (cache, method) => {
18
18
const compilationCache = Object . create ( null )
19
19
const normalizeRender = vm => {
20
20
const { render, template } = vm . $options
21
- if ( ! render && template ) {
22
- const renderFns = (
23
- compilationCache [ template ] ||
24
- ( compilationCache [ template ] = compileToFunctions ( template ) )
25
- )
26
- Object . assign ( vm . $options , renderFns )
21
+ if ( ! render ) {
22
+ if ( template ) {
23
+ const renderFns = (
24
+ compilationCache [ template ] ||
25
+ ( compilationCache [ template ] = compileToFunctions ( template ) )
26
+ )
27
+ Object . assign ( vm . $options , renderFns )
28
+ } else {
29
+ throw new Error (
30
+ `render function or template not defined in component: ${
31
+ vm . $options . name || vm . $options . _componentTag || 'anonymous'
32
+ } `
33
+ )
34
+ }
27
35
}
28
36
}
29
37
You can’t perform that action at this time.
0 commit comments