小程序组件样式不支持id和属性与标签选择器怎么办?

发布于 8 年前作者 leiwei1165 次浏览最后编辑 8 年前来自 ask
  • 当前 Bug 的表现(可附上截图)

  • 预期表现

  • 复现路径

  • 提供一个最简复现 Demo

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

小程序组件中不支持id 属性 标签这些选择器,该怎么办?

2 回复
xiazeng
xiazeng1 楼6 年前

不支持就不用

yixiuying
yixiuying2 楼6 年前

我今天也遇到这个问题了,下午的时候有个组件用了attribute selectors写样式,明明是有生效的,晚上再打开项目就报这个错误了