wepy icon indicating copy to clipboard operation
wepy copied to clipboard

wepy2 插槽slot代码插入层级错乱问题

Open Bulandent opened this issue 5 years ago • 2 comments

parent.wpy:

<template>
    <view>parent</view>
    <child>
        <view>child view</view>
    </child>
</template>

child.wpy:

<template>
    <view>  
        <view>child</view>
        <slot></slot>
    </view>
</template>

期望的编译后的template是:

<template>
    <view>parent</view>
    <view>
        <view>child</view>
        <view>child view</view>
    </view>
</template>

而实际wepy2编译后的template是会将对应的内容插入到子组件与根元素并列那级:

<template>
    <view>parent</view>
    <view>
        <view>child</view>
    </view>
    <view>child view</view>
</template>

Bulandent avatar Jul 13 '20 03:07 Bulandent

我也发现这个问题了。。。

jasonHG avatar Jul 16 '20 09:07 jasonHG

这里有一份wepy2升级指南 https://github.com/Bulandent/blog/issues/4

Bulandent avatar Aug 07 '20 00:08 Bulandent