组件化component中,wxss样式 :host 设置问题
发布于 5 年前 作者 lxue 10917 次浏览 来自 问答

设置 :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.

8 回复

手机上的是1.7.3

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

.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 如何来写呢,官方还支持

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

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

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

: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}

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

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

最新的工具是

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

回到顶部