引全局样式后Some selectors are not allowed in component?

发布于 6 年前作者 lihao984 次浏览最后编辑 6 年前来自 ask

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

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

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

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

1 回复
gang93
gang931 楼4 年前

谢邀,不太清楚