Ask questionsCan not clear slot content with vue@2.5.3



Reproduction link

Steps to reproduce

Create a Base Component with a slot, and pass in the slot with template tag with empty content.

What is expected?

The empty template slot should clear the content of Base Component's corresponding slot.

What is actually happening?

Did not clear the content.

However, the vue@2.4.4 do the right thing:

<!-- generated by vue-issues. DO NOT REMOVE -->


Answer questions alexshink

So far, the best I've come up with is to use an empty separate component with a template: <i v-if="false"></i>, which allows you to bypass the rendering of unnecessary empty tags.


Related questions

如何通过v-bind:style动态生成背景图? hot 7
force re-computation of a computed property hot 3
Error thrown when using transition-group with conditionally rendered children hot 3
Vuejs type inference does not work with TS 3.4.x hot 3
Property 'X' does not exist on type CombinedVueInstance using TypeScript Prop Validator hot 2
[Vue warn]: Error in nextTick: "RangeError: Maximum call stack size exceeded" while navigating to another route hot 1
关于keep-alive缓存页面问题请教 hot 1
TypeError: Cannot read property 'toLowerCase' of undefined at emptyNodeAt hot 1
VNode.componentInstance is undefined when rendered by a functional component hot 1
Korean input trigger keydown event twice hot 1
Proposal: Template inheritance using the slots mechanism hot 1
Memory leak when using "transition" and "keep-alive" hot 1
Error in v-on handler: "RangeError: Maximum call stack size exceeded" hot 1
如何通过v-bind:style动态生成背景图? hot 1
Different functional componens has the same key hot 1
Github User Rank List