weex icon indicating copy to clipboard operation
weex copied to clipboard

slot 问题

Open sin-ning opened this issue 9 years ago • 1 comments

playground 最新版本


<template>
  <div class="div">
    <banner></banner>
    <panel>
        <text slot="leftContent">生活</text>
        <text>center</text>
        <text slot="rightContent">更多</text>
    </panel>
  </div>
</template>

<template>
    <div class="title">
        <div class="titleLeft">
            <slot name="leftContent"></slot>
        </div>
        <div class="titleCenter">
            <slot></slot>
        </div>
        <div class="titleRight">
            <slot name="rightContent"></slot>
        </div>
    </div>
</template>

image

渲染始终在最后一个 slot

sin-ning avatar Dec 26 '16 04:12 sin-ning

Weex 现在不支持多个 <slot> 也不支持 <slot name> 这样的写法,所以上述代码的运行结果不可预期…… 将来的 Vue 2.0 将支持比较完整的 slot 语法,尽请关注 谢谢你的反馈

Jinjiang avatar Dec 27 '16 15:12 Jinjiang