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) => {
1818const compilationCache = Object . create ( null )
1919const normalizeRender = vm => {
2020 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+ }
2735 }
2836}
2937
You can’t perform that action at this time.
0 commit comments