File tree Expand file tree Collapse file tree 1 file changed +4
-9
lines changed
packages/compiler-sfc/src Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -162,9 +162,9 @@ export function parse(
162162 ignoreEmpty &&
163163 node . tag !== 'template' &&
164164 isEmpty ( node ) &&
165- ! hasProp ( node , 'src' ) &&
166- ! hasProp ( node , 'vapor' )
165+ ! hasAttr ( node , 'src' )
167166 ) {
167+ descriptor . vapor ||= hasAttr ( node , 'vapor' )
168168 return
169169 }
170170 switch ( node . tag ) {
@@ -410,13 +410,8 @@ function padContent(
410410 }
411411}
412412
413- function hasProp ( node : ElementNode , name : string ) {
414- return node . props . some ( p => {
415- if ( p . type !== NodeTypes . ATTRIBUTE ) {
416- return false
417- }
418- return p . name === name
419- } )
413+ function hasAttr ( node : ElementNode , name : string ) {
414+ return node . props . some ( p => p . type === NodeTypes . ATTRIBUTE && p . name === name )
420415}
421416
422417/**
You can’t perform that action at this time.
0 commit comments