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(
162
162
ignoreEmpty &&
163
163
node . tag !== 'template' &&
164
164
isEmpty ( node ) &&
165
- ! hasProp ( node , 'src' ) &&
166
- ! hasProp ( node , 'vapor' )
165
+ ! hasAttr ( node , 'src' )
167
166
) {
167
+ descriptor . vapor ||= hasAttr ( node , 'vapor' )
168
168
return
169
169
}
170
170
switch ( node . tag ) {
@@ -410,13 +410,8 @@ function padContent(
410
410
}
411
411
}
412
412
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 )
420
415
}
421
416
422
417
/**
You can’t perform that action at this time.
0 commit comments