<button data-item="{{item}}" class="fx-group" hover-class='none' open-type="share">
</button>
- 发布:2020-10-29 14:56
- 更新:2020-10-29 15:26
- 阅读:1126
产品分类: uniapp/小程序/微信
PC开发环境操作系统: Windows
PC开发环境操作系统版本号: win10
HBuilderX类型: 正式
HBuilderX版本号: 2.9.3
第三方开发者工具版本号: 未知
基础库版本号: 未知
项目创建方式: HBuilderX
示例代码:
操作步骤:
14:51:27.550 Module Error (from ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js):
14:51:27.559 (Emitted value instead of an instance of Error)
14:51:27.576 Errors compiling template:
14:51:27.581 data-item="{{item}}": Interpolation inside attributes has been removed. Use v-bind or the colon shorthand instead. For example, instead of <div id="{{ val }}">, use <div :id="val">.
14:51:27.550 Module Error (from ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js):
14:51:27.559 (Emitted value instead of an instance of Error)
14:51:27.576 Errors compiling template:
14:51:27.581 data-item="{{item}}": Interpolation inside attributes has been removed. Use v-bind or the colon shorthand instead. For example, instead of <div id="{{ val }}">, use <div :id="val">.
预期结果:
<button data-item="{{item}}" class="fx-group" hover-class='none' open-type="share">
</button>
<button data-item="{{item}}" class="fx-group" hover-class='none' open-type="share">
</button>
实际结果:
14:51:27.550 Module Error (from ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js):
14:51:27.559 (Emitted value instead of an instance of Error)
14:51:27.576 Errors compiling template:
14:51:27.581 data-item="{{item}}": Interpolation inside attributes has been removed. Use v-bind or the colon shorthand instead. For example, instead of <div id="{{ val }}">, use <div :id="val">.
14:51:27.550 Module Error (from ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js):
14:51:27.559 (Emitted value instead of an instance of Error)
14:51:27.576 Errors compiling template:
14:51:27.581 data-item="{{item}}": Interpolation inside attributes has been removed. Use v-bind or the colon shorthand instead. For example, instead of <div id="{{ val }}">, use <div :id="val">.
bug描述:
<button data-item="{{item}}" class="fx-group" hover-class='none' open-type="share">
</button>
微信小程序分享按钮带有data-tiem="{{item}}"
就会报错,微信小程序可以正常运行,但是uniapp不可
1 个回复
a***@astcn.net
先认真学习一下vue和uniapp的基本语法吧