2***@qq.com
2***@qq.com
  • 发布:2019-10-11 18:08
  • 更新:2019-12-25 15:19
  • 阅读:6927

Some selectors are not allowed in component wxss,

分类:HBuilderX

详细问题描述

自定义组件

App 提示:
Some selectors are not allowed in component wxss, including tag name selectors, ID selectors, and attribute selectors.(./components/search-comp/search-comp.wxss:17:8)This wxss file is ignored. at app-view.js:6732
导致样式错乱

小程序提示:
Some selectors are not allowed in component wxss, including tag name selectors, ID selectors, and attribute selectors.(./components/no-data/no-data.wxss:17:8)

没有使用标签、元素、id和属性等选择器

[内容]
app

微信小程序

重现步骤

[步骤]

[结果]

[期望]

app提示警告,但是运行结果与小程序一致,至少不会导致页面样式忽略掉

IDE运行环境说明

[HBuilder 或 HBuilderX。如果你用其他工具开发uni-app,也需要在此说明]
HBuilderX2.3.3.20190923
[IDE版本号]

[windows版本号]

[mac版本号]

uni-app运行环境说明

[运行端是h5或app或某个小程序?]

[运行端版本号]

[项目是cli创建的还是HBuilderX创建的?如果是cli创建的,请更新到最新版cli再试]

[编译模式是老模板模式还是新的自定义组件模式?]

App运行环境说明

[Android版本号]

[iOS版本号]

[手机型号]

[模拟器型号]

附件

[IDE问题请提供HBuilderX运行日志。菜单帮助-查看运行日志,点右键打开文件所在目录,将log文件压缩成zip包上传]

[App问题请提供可重现问题的代码片段,你补充的细一点,问题就解决的快一点]

[App安装包或H5地址]

[可重现代码片段]

联系方式

[QQ] 240701740

2019-10-11 18:08 负责人:无 分享
已邀请:
1***@qq.com

1***@qq.com

今天也遇到这个问题,莫名其妙所有组件都会报这个错误 ,小程序和h5都只是警告,真机测试时,组件样式全部挂掉了,,然后经过回退git历史,发现是因为将iconfont.scss导入到uni.scss中了。
解决方法就是,将iconfont.scss从uni.scss中拿出来,在App.vue中导入。

2***@qq.com

2***@qq.com (作者)

运行日志:
2019-10-11 18:10:27 [LanguageServerProcess] java.net.SocketException: Connection reset by peer: socket write error
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(Unknown Source)
at java.net.SocketOutputStream.write(Unknown Source)
at java.io.DataOutputStream.write(Unknown Source)
at java.io.DataOutputStream.writeUTF(Unknown Source)
at java.io.DataOutputStream.writeUTF(Unknown Source)
at com.pandora.console.core.thread.ConsoleMessageThread.run(ConsoleMessageThread.java:70)
2019-10-11 18:10:27.517 [WARNING:] QProcess: Destroyed while process ("D:\soft\HBuilderX\plugins\jre\bin\java.exe") is still running.

2019-10-11 18:10:27.542 [WARNING:] uniapp compiled errorOccurred====== "进程已崩溃"

2019-10-11 18:10:31.968 [INFO:] refresh next project status

2019-10-11 18:10:32.026 [INFO:] PathTraverse deleted

2019-10-11 18:10:32.532 [INFO:] refresh next project status

2019-10-11 18:10:32.536 [INFO:] no project need to refresh.

2019-10-11 18:10:33.363 [INFO:] refresh next project status

2019-10-11 18:10:33.420 [INFO:] PathTraverse deleted

2019-10-11 18:10:33.927 [INFO:] refresh next project status

2019-10-11 18:10:33.931 [INFO:] no project need to refresh.

2019-10-11 18:10:35.160 [INFO:] refresh next project status

2019-10-11 18:10:35.222 [INFO:] PathTraverse deleted

2019-10-11 18:10:36.162 [INFO:] refresh next project status

2019-10-11 18:10:36.248 [INFO:] PathTraverse deleted

2019-10-11 18:10:36.902 [INFO:] refresh next project status

2019-10-11 18:10:36.968 [INFO:] PathTraverse deleted

2019-10-11 18:10:37.474 [INFO:] refresh next project status

2019-10-11 18:10:37.479 [INFO:] no project need to refresh.

2019-10-11 18:10:39.270 [INFO:] refresh next project status

2019-10-11 18:10:39.332 [INFO:] PathTraverse deleted

2019-10-11 18:10:39.832 [INFO:] refresh next project status

2019-10-11 18:10:39.837 [INFO:] no project need to refresh.

2019-10-11 18:10:42.036 [INFO:] refresh next project status

2019-10-11 18:10:42.101 [INFO:] PathTraverse deleted

2019-10-11 18:10:42.598 [INFO:] refresh next project status

2019-10-11 18:10:42.603 [INFO:] no project need to refresh.

2019-10-11 18:10:43.973 [INFO:] refresh next project status

2019-10-11 18:10:44.029 [INFO:] PathTraverse deleted

2019-10-11 18:10:44.553 [INFO:] refresh next project status

2019-10-11 18:10:44.609 [INFO:] PathTraverse deleted

2019-10-11 18:10:45.113 [INFO:] refresh next project status

2019-10-11 18:10:45.117 [INFO:] no project need to refresh.

2019-10-11 18:10:46.411 [INFO:] refresh next project status

2019-10-11 18:10:46.465 [INFO:] PathTraverse deleted

2019-10-11 18:10:46.971 [INFO:] refresh next project status

2019-10-11 18:10:46.976 [INFO:] no project need to refresh.

2019-10-11 18:11:01.808 [WARNING:] [MENU] !!!Can't find the action id: "workbench.action.testExpr"

2019-10-11 18:11:03.116 [INFO:] [workspace/clearIndexTask] "{\"message\":\".log构建完成。\",\"projectpath\":\"C:\\Users\\yibbay\\AppData\\Roaming\\HBuilder X\\.log\"}"

gxlqssjf

gxlqssjf

怎么解决这个问题,什么标签啊?

  • 2***@qq.com (作者)

    暂时我现在是这么处理的,既然忽略我的css文件了,我就写一份公用的,在app端全局引入

    2019-10-18 14:07

该问题目前已经被锁定, 无法添加新回复