报错内容:
[HBuilder] 17:10:34.506 提示:非 h5 平台 :key 不支持表达式 'hot-floor'+index1,详情参考:https://uniapp.dcloud.io/use?id=key
[HBuilder] 17:10:34.506 at pages/index/index.vue:1
[HBuilder] 17:10:34.884 提示:非 h5 平台 :key 不支持表达式 'hot-floor'+index1,详情参考:https://uniapp.dcloud.io/use?id=key
[HBuilder] 17:10:34.884 at pages/product/subjectSection.vue:1
[HBuilder] 17:10:51.789 [错误] ./pages/index/index.wxml:1:4639: Bad attr data-event-opts
with message: unexpected token hot
.
[HBuilder] 17:10:52.134 DONE Build complete.
[HBuilder] 17:10:52.134 项目 'git_uni_app_wx' 编译成功.
[HBuilder] 17:10:52.151 Module build failed (from ./node_modules/vue-loader/lib/loaders/templateLoader.js):
[HBuilder] 17:10:52.169 TypeError: Property name expected type of string but got null
[HBuilder] 17:10:52.182 at validate (/Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/uni-template-compiler/node_modules/@babel/types/lib/definitions/utils.js:164:13)
[HBuilder] 17:10:52.183 at Object.validate (/Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/uni-template-compiler/node_modules/@babel/types/lib/definitions/utils.js:201:7)
[HBuilder] 17:10:52.207 at validateField (/Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/uni-template-compiler/node_modules/@babel/types/lib/validators/validate.js:22:9)
[HBuilder] 17:10:52.207 at validate (/Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/uni-template-compiler/node_modules/@babel/types/lib/validators/validate.js:16:3)
[HBuilder] 17:10:52.233 at builder (/Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/uni-template-compiler/node_modules/@babel/types/lib/builders/builder.js:46:27)
[HBuilder] 17:10:52.245 at Object.Identifier (/Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/uni-template-compiler/node_modules/@babel/types/lib/builders/generated/index.js:323:31)
[HBuilder] 17:10:52.267 at ReturnStatement (/Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/uni-template-compiler/lib/script/traverse/data/event.js:270:49)
[HBuilder] 17:10:52.293 at NodePath._call (/Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/uni-template-compiler/node_modules/@babel/traverse/lib/path/context.js:53:20)
[HBuilder] 17:10:52.318 at NodePath.call (/Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/uni-template-compiler/node_modules/@babel/traverse/lib/path/context.js:40:17)
[HBuilder] 17:10:52.348 at NodePath.visit (/Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/uni-template-compiler/node_modules/@babel/traverse/lib/path/context.js:88:12)
[HBuilder] 17:10:52.374 at TraversalContext.visitQueue (/Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/uni-template-compiler/node_modules/@babel/traverse/lib/context.js:118:16)
[HBuilder] 17:10:52.400 at TraversalContext.visitMultiple (/Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/uni-template-compiler/node_modules/@babel/traverse/lib/context.js:85:17)
[HBuilder] 17:10:52.428 at TraversalContext.visit (/Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/uni-template-compiler/node_modules/@babel/traverse/lib/context.js:144:19)
[HBuilder] 17:10:52.454 at Function.traverse.node (/Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/uni-template-compiler/node_modules/@babel/traverse/lib/index.js:94:17)
[HBuilder] 17:10:52.480 at NodePath.visit (/Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/uni-template-compiler/node_modules/@babel/traverse/lib/path/context.js:95:18)
[HBuilder] 17:10:52.510 at TraversalContext.visitQueue (/Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/uni-template-compiler/node_modules/@babel/traverse/lib/context.js:118:16)
[HBuilder] 17:10:52.545 ERROR Build failed with errors.
[HBuilder] 17:10:52.575 项目 'git_uni_app_wx'导出失败
2***@qq.com
- 发布:2019-09-09 17:15
- 更新:2019-09-21 17:10
- 阅读:2762
4 个回复
星澜软件科技 - 软件开发
解决了吗,朋友
只吃炸鸡 - 优秀的前端学习者
data-event-opts 这个错误解决了吗?兄弟
1***@163.com
兄弟你解决了么
2019-09-19 16:58
只吃炸鸡
回复 1***@163.com: 解决了,是因为我们把js运算写到了行内标签里
2019-10-12 16:14
auisdusaidisad
回复 只吃炸鸡: 怎么解决的
2020-05-09 16:06
只吃炸鸡
回复 auisdusaidisad: 忘了.....
2023-02-24 09:18
1***@163.com
谁解决了,告诉一下
i***@sina.com - u
hbuilderx 版本 2.2.2.20190816
复现的方式
input标签 将type设置为变量
比如
<input :type="type" />
type不管存在与否,都直接编译报错
删除:type="input.type"后,编译正常