设置 :host 样式之后,报错:

Some selectors are not allowed in component wxss, including tag name selectors, ID selectors, and attribute selectors.(::2:1)This wxss file is ignored.

网友回复:

杨***:

 我试验了一下,也是报同样的错误

【已解决】组件化component中,wxss样式 :host 设置问题

杨***:

另外如果我想写这样的代码

.weui-cells:before{top:0;border-top:1rpx solid #d9d9d9}.weui-cells:after,.weui-cells:before{content:" ";position:absolute;left:0;right:0;height:1px;color:#d9d9d9}.weui-cells:after{bottom:0;border-bottom:1rpx solid #d9d9d9}

改成:host 如何来写呢,官方还支持

L***:

抱歉,这个是文档提前发布了的问题。稍后我们会发布新版开发者工具支持。

J***:系统记录

L***:

你好,我们已经发布了1.7.3,且文档已更新,请参考新的文档。

杨***:

1.7.3 没有找到啊,新的文档还是以前的那些说明

新颖的工具是 【已解决】组件化component中,wxss样式 :host 设置问题

【已解决】组件化component中,wxss样式 :host 设置问题

L***:

手机上的是1.7.3

杨***:

现在可以实现这样的样式吗

:host::before{top:0;border-top:1rpx solid #d9d9d9}

:host::after,

:host::before{content:" ";position:absolute;left:0;right:0;height:1px;color:#d9d9d9}

:host::after{bottom:0;border-bottom:1rpx solid #d9d9d9}

L***:

不可以的,我们现在只开放了基本的 :host 单独使用的情况。

爱盈利-运营小咖秀(www.aiyingli.com) 始终坚持研究分享移动互联网App运营推广经验、策略、全案、渠道等纯干货知识内容;是广大App运营从业者的知识启蒙、成长指导、进阶学习的集聚平台;

想了解更多移动互联网干货知识,请关注微信公众号运营小咖秀(ID: yunyingshow)