引全局样式后Some selectors are not allowed in component?
发布于 4 年前 作者 lihao 781 次浏览 来自 问答

现象:自定义组件样式文件中引入了全局样式,会报“Some selectors are not allowed in component wxss, includi…”的警告

原因:全局样式中,对page标签进行了样式设置,写法: page { … },使用了标签选择名选择器的写法。

推测:当取消引入全局样式或注释掉全局样式中page的样式设置,则无警告

问:希望保留对page的样式设置,还能在自定义组件中引入全局样式,不提示警告。

1 回复

谢邀,不太清楚

回到顶部