Skip to content

Commit ad7a727

Browse files
fix: empty template on one line or no template tag causes error
Having an empty template on one line or no tempate tag at all would incorrectly fallback to the deprecated template format where template tags were ommited. See: spacetelescope/jdaviz#2668 and widgetti/solara#625
1 parent 9a2cd85 commit ad7a727

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

js/src/VueTemplateRenderer.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,9 @@ function createComponentObject(model, parentView) {
102102
...createFullVueComponents(fullVueComponents),
103103
},
104104
computed: { ...vuefile.SCRIPT && vuefile.SCRIPT.computed, ...aliasRefProps(model) },
105-
template: vuefile.TEMPLATE || template,
105+
template: vuefile.TEMPLATE === undefined && vuefile.SCRIPT === undefined && vuefile.STYLE === undefined
106+
? template
107+
: vuefile.TEMPLATE,
106108
beforeMount() {
107109
callVueFn('beforeMount', this);
108110
},

0 commit comments

Comments
 (0)