Skip to content

Commit

Permalink
fix: empty template on one line or no template tag causes error
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mariobuikhuizen committed May 1, 2024
1 parent 9a2cd85 commit a0b587e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion js/src/VueTemplateRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,9 @@ function createComponentObject(model, parentView) {
...createFullVueComponents(fullVueComponents),
},
computed: { ...vuefile.SCRIPT && vuefile.SCRIPT.computed, ...aliasRefProps(model) },
template: vuefile.TEMPLATE || template,
template: vuefile.TEMPLATE === undefined && vuefile.SCRIPT === undefined && vuefile.STYLE === undefined
? template
: vuefile.TEMPLATE,
beforeMount() {
callVueFn('beforeMount', this);
},
Expand Down

0 comments on commit a0b587e

Please sign in to comment.