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

嵌套组件中使用slot无法正常渲染 #585

Open
heriky opened this issue Jun 4, 2018 · 21 comments
Open

嵌套组件中使用slot无法正常渲染 #585

heriky opened this issue Jun 4, 2018 · 21 comments
Labels
wontfix This will not be worked on

Comments

@heriky
Copy link

heriky commented Jun 4, 2018

自定义组件中使用了slot传递内部组件,但是如果在嵌套组件中使用slot,slot对应的内容不会显示。请问这个问题有解决方案了吗???

定义组件

image

使用组件

image

@hualongdai
Copy link

这个 问题 好像到现在都不能支持!

@oograce
Copy link

oograce commented Jun 7, 2018

试试把组件style上scoped属性去掉

@wjy4124
Copy link

wjy4124 commented Jun 7, 2018

试试把 组件名换成驼峰

@heriky
Copy link
Author

heriky commented Jun 7, 2018

@wjy4124 vue模板中本身不识别驼峰形式的写法吧

@hualongdai
Copy link

@heriky 支持驼峰的

@wjy4124
Copy link

wjy4124 commented Jun 7, 2018

这货好像不会自动 转换名命
components 里是驼峰 template 里就要用驼峰
可以在 components 里定义成 中横线的命名

@heriky
Copy link
Author

heriky commented Jun 7, 2018

@wjy4124 仍然渲染不出来,心塞。
image
image

渲染出来嵌套组件内部的值全部失效。

这个问题大幅度限制了组件的组合能力。

@JRliu
Copy link

JRliu commented Jun 13, 2018

我也被坑了,但我无意中发现,mpvue@1.0.11,mpvue-template-compiler@1.0.11,mpvue-loader@1.0.13 的环境下嵌套组件的slot可以正常使用,其他情况slot的作用域跑到父组件那里去了

@zWingz
Copy link

zWingz commented Jun 13, 2018

@JRliu 我也恰好遇到这个问题...作用域跑到父组件上面去了

@zWingz
Copy link

zWingz commented Jun 13, 2018

@JRliu mpvue@1.0.11还真能解决问题..

@limichange
Copy link

@JRliu @zWingz 如果降版本就能正常是吗?

@limichange
Copy link

😅 发现降版本也没有用。

@heriky
Copy link
Author

heriky commented Jun 15, 2018

这个问题官方没打算修复一下吗

@zWingz
Copy link

zWingz commented Jun 15, 2018

@limichange 我降了版本可以用哦~, 我只降了mpvue和compiler.

@VimMing
Copy link

VimMing commented Jun 18, 2018

@JRliu 把版本换成1.0.11行是行, 有2个具名的slot, 它只给我渲染出一个, 列表有时渲染的出, 有时渲染不出, 真的被吓怕了

@JRliu
Copy link

JRliu commented Jun 19, 2018

@VimMing 我选择用小程序原生的代码实现那些嵌套slot的组件,mpvue做没嵌套的组件

@limichange
Copy link

🤣 但是降版本不会出别的问题嘛

@limichange
Copy link

@zWingz 能贴一下你的devDependencies吗?

@zWingz
Copy link

zWingz commented Jun 26, 2018

@limichange 需要slot的我都改用小程序原生组件了

@limichange
Copy link

@zWingz 你这个混用小程序原生组件是怎么做到的?

@mpvue-bot mpvue-bot bot added the wontfix This will not be worked on label Oct 23, 2018
@mpvue-bot
Copy link

mpvue-bot bot commented Oct 23, 2018

issue超过30天无更新或响应,7天后将自动关闭,如果问题状态有更新请及时更新issue

@mpvue-bot mpvue-bot bot closed this as completed Oct 30, 2018
@aOrz aOrz reopened this Oct 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

9 participants