Vue: slot can't use in vue transtion component

Created on 8 Dec 2016  Â·  4Comments  Â·  Source: vuejs/vue

Soucce code of defined transition-demo component

<template>
  <div class="doc-ctn computed">
    <h4 class="ctn-title">transition</h4>
    <div class="ctn-demo">

      <transition name="demo">
        <!-- slot fangzai   -->
        <slot ></slot>
      </transition>
    </div>
  </div>
</template>

Then i use transition demo component in parent component:

<transition-demo>
        I am disappearing
</transition-demo>

content ' I am disappearing' dose not rendered.

need repro

Most helpful comment

In your usage the slot expands to a piece of plain text, which is not transition-able. Wrap it in an element like <span>.

All 4 comments

Please follow the Issue Reporting Guidelines and provide a minimal JSFiddle or JSBin containing a set of reproducible steps that can lead to the behaviour you described.

In your usage the slot expands to a piece of plain text, which is not transition-able. Wrap it in an element like <span>.

thanks a lot

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hiendv picture hiendv  Â·  3Comments

lmnsg picture lmnsg  Â·  3Comments

seemsindie picture seemsindie  Â·  3Comments

loki0609 picture loki0609  Â·  3Comments

bdedardel picture bdedardel  Â·  3Comments