vue的render中如何实现v-show

用template中写完, 通过isShow可以实现动画, 但是为什么我用render实现的就不好使了呢? 

请问我的render的问题在哪里?

切换有动画

  <transition name="fadeUp">

      <span v-show="isShow" class="atom-popper">

          <slot>{ {content}}</slot>

      </span>

  </transition>

切换无动画

   render(h) {

        return h(

            'transition',

            {

                attrs: { name: 'fadeUp' }

            }, [

                h(

                    'span',

                    {

                        class: ['atom-popper'],

                        style: { display: this.isShow ? undefined : 'none' }

                    },

                    [this.content || this.$slots.default]

                )

            ]

        );

    },

猜你喜欢

转载自blog.csdn.net/weixin_42776027/article/details/113838449