profile
viewpoint

Ask questionsCan not clear slot content with vue@2.5.3

Version

2.5.3

Reproduction link

https://jsfiddle.net/yibuyisheng/s5xoxmv1/6/

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: https://jsfiddle.net/yibuyisheng/s5xoxmv1/7/

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

vuejs/vue

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.

useful!

Related questions

[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
如何通过v-bind:style动态生成背景图? hot 1
IE11, console print: [Vue warn]: Error in nextTick: "Error: Invalid argument." But work well with chrome hot 1
v-bind:style 'background-image' error: url is not a function hot 1
force re-computation of a computed property hot 1
v-model on mobile not updating until a space is pressed hot 1
There is no a attribute like react's $$typeof to prevent XSS injection in the vnode of Vue. hot 1
Github User Rank List