Skip to content

Commit

Permalink
fix: 组件中没有child,只有 scopedslot 时,scopedslot 不会被渲染
Browse files Browse the repository at this point in the history
  • Loading branch information
meixg committed Jun 3, 2019
1 parent 30f2d79 commit c0b7309
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions packages/mars-build/src/compiler/template/generate.js
Expand Up @@ -55,10 +55,6 @@ module.exports = function generate(obj, options = {}) {
return `${spaceLine}<${tag}${attrs ? ' ' + attrs : ''} />${ifText}`;
}

if (!child) {
return `${spaceLine}<${tag}${attrs ? ' ' + attrs : ''}></${tag}>${ifText}`;
}

return `${spaceLine}<${tag}${attrs ? ' ' + attrs : ''}>${child || ''}${slots || ''}</${tag}>${ifText}`;
};

Expand Down

0 comments on commit c0b7309

Please sign in to comment.