Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Bulandent opened this issue Jul 13, 2020 · 2 comments
Open

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

Bulandent opened this issue Jul 13, 2020 · 2 comments
Labels
2.0.x Version 2.0.x bug

Comments

@Bulandent
Copy link

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>
@jasonHG
Copy link

jasonHG commented Jul 16, 2020

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

@Bulandent
Copy link
Author

这里有一份wepy2升级指南
Bulandent/blog#4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.0.x Version 2.0.x bug
Projects
None yet
Development

No branches or pull requests

3 participants