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

关于自定义组件 #305

Closed
shawtung opened this issue Apr 18, 2018 · 11 comments
Closed

关于自定义组件 #305

shawtung opened this issue Apr 18, 2018 · 11 comments

Comments

@shawtung
Copy link

shawtung commented Apr 18, 2018

1.想问问之所以不使用原生自定义组件是因为开发mpvue的时候原生还没有吗? 后续会考虑用原生实现吗?

2.现在的自定义组件里内部也是要求只有唯一顶级元素的, 那为什么不能跟正常vue一样在自定义组件标签上绑定东西? 是因为小程序template标签的锅么?

@F-loat
Copy link
Contributor

F-loat commented Apr 18, 2018

  1. 小程序的原生自定义组件是支持的吧 demo

  2. 原生自定义组件1.6.3的基础库才支持,用这个来实现组件化不太合适

@shawtung
Copy link
Author

现在基础库版本到2.0.0了呀~还需要考虑1.6.3吗?

@shawtung
Copy link
Author

我的意思是mpvue实现的自定义组件, 并没有使用原生component来实现, 是考虑到基础库版本的问题吗?
@F-loat

@F-loat
Copy link
Contributor

F-loat commented Apr 18, 2018

会有这方面的考虑吧,另外改写也需要时间,而且微信的版本也没那么乐观的

@shawtung
Copy link
Author

好的,谢谢啦~

@rchunping
Copy link

我觉得需要更多评估一下,目前遇到一个问题,原生的自定义组件z-index无法提升覆盖父级组件(iOS上)
因为原生自定义组件在Shadow DOM里,CSS独立,一些组件效果将无法实现。

@shawtung
Copy link
Author

@rchunping
没有理解何为无法提升覆盖父组件..
比如可能会有哪些效果无法实现呢?

@rchunping
Copy link

@shawtung 比如要做个对话框组件,一般是需要一个半透明全屏遮盖层的,这时候iOS上,遮盖层的z-index无法让它覆盖在页面其他有z-index的区域上面。

当然这不是组件的问题,是各内核对Shadow DOM的处理不一致

@shawtung
Copy link
Author

shawtung commented Apr 18, 2018

@rchunping 了解了, 看起来又是个美丽的饼... 得等web components完全标准化之后才能愉快地玩耍了.
谢谢~

@rchunping
Copy link

@shawtung 反正目前原生的自定义组件也能在mpvue里用的

@shawtung
Copy link
Author

@rchunping 嗯, 但是写法有差别而且没有watch, computed这些有用的东西, 这很不vue, 一般情况不用也罢.

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

No branches or pull requests

3 participants