各位开发者好。
如果您在上传或预览出现这种情况的话,【wxml 编译错误,错误信息:pages/index/index.wxml:279:113: Bad attr `wx:key` with message: unexpected token `em`.】
这个是源码出现问题,上述提示在具体的文件夹,具体的线上出现空格键。比如上述就是在pages/index/index.wxml文件里面的279线上第113个字符的em出现空格键。
把这个空格键进行删除,在按保存。然后还会出现这种相类似的文件夹中出现wx:key中*this 把*去掉在保存。直到你所有的this前没有*。这个小程序就大功告成了。希望能帮到你们。亲测。
哪位大神知道hbuilderx运行项目启动微信开发者工具后报这个错误,代码完全没问题,升级工具后就出现这个问题了,回退版本也不行
大佬看看这啥错误
[ WXML 文件编译错误] ./pages/index/index.wxml
unexpected character `+`
121 | var series = [];
122 |
> 123 | for (let i = 0; i < byList.length; i++) {undefined
| ^
124 |
125 | var sale = {};
126 |
at files://pages/index/index.wxml#123(env: Windows,mp,1.05.2110290; lib: 2.19.4)
[ WXML 文件编译错误] ./pages/shop/task.wxml
Bad attr `data-event-params` with message
63 | <view class="welfare_bottom_item" wx:for="{{donetaskList}}" wx:for-item="tdItem" wx:key="index">
64 | <view class="welfare_bottom_item_two">
> 65 | <view bindtap="__e" class="welfare_item_left" data-event-opts="{{[ [ 'tap',[ [ 'e1',['$event'] ] ] ] ]}}" data-event-params="{{tdItem:tdItem}}" data-index="{{index}}">
| ^
66 | <view class="welfare_item_left_h1">{{tdItem.name}}</view>
67 | <view class="welfare_item_left_h2">
68 | <grace-single-slider barBgColor="{{'linear-gradient(to right, '+(tdItem.barBgColor_left?tdItem.barBgColor_left:'#ffbf8a')+','+(tdItem.barBgColor_right?tdItem.barBgColor_right:'#ff9966')+')'}}" barHeight="{{50}}" barText="{{tdItem.bili}}" barTextSize="26rpx" barWidth="{{tdItem.width}}" bglineAColor="{{tdItem.bglineAColor?tdItem.bglineAColor:'#ff9966'}}" bglineColor="{{tdItem.bglineColor?tdItem.bglineColor:'#e5e5e5'}}" bglineSize="{{50}}" bind:__l="__l" borderRadius="40rpx" canSlide="{{false}}" style="width:540rpx;" vueId="{{'4e5601d1-3-'+index+','+'4e5601d1-1'}}"></grace-single-slider>
at files://pages/shop/task.wxml#65(env: Windows,mp,1.05.2110290; lib: 2.11.2)
请问这个是什么问题?
[ WXML 文件编译错误] ./pages/shop/task.wxml
Bad attr `data-event-params` with message
63 | <view class="welfare_bottom_item" wx:for="{{donetaskList}}" wx:for-item="tdItem" wx:key="index">
64 | <view class="welfare_bottom_item_two">
> 65 | <view bindtap="__e" class="welfare_item_left" data-event-opts="{{[ [ 'tap',[ [ 'e1',['$event'] ] ] ] ]}}" data-event-params="{{tdItem:tdItem}}" data-index="{{index}}">
| ^
66 | <view class="welfare_item_left_h1">{{tdItem.name}}</view>
67 | <view class="welfare_item_left_h2">
68 | <grace-single-slider barBgColor="{{'linear-gradient(to right, '+(tdItem.barBgColor_left?tdItem.barBgColor_left:'#ffbf8a')+','+(tdItem.barBgColor_right?tdItem.barBgColor_right:'#ff9966')+')'}}" barHeight="{{50}}" barText="{{tdItem.bili}}" barTextSize="26rpx" barWidth="{{tdItem.width}}" bglineAColor="{{tdItem.bglineAColor?tdItem.bglineAColor:'#ff9966'}}" bglineColor="{{tdItem.bglineColor?tdItem.bglineColor:'#e5e5e5'}}" bglineSize="{{50}}" bind:__l="__l" borderRadius="40rpx" canSlide="{{false}}" style="width:540rpx;" vueId="{{'4e5601d1-3-'+index+','+'4e5601d1-1'}}"></grace-single-slider>
at files://pages/shop/task.wxml#65(env: Windows,mp,1.05.2110110; lib: 2.19.4)
这是什么问题
这个呢
导入项目后出现这个问题怎么解决
[ WXML 文件编译错误] ./u_pages/article/index.wxml
Bad attr `params` with message
2 | <modal-black-list bind:__l="__l" class="data-v-4ba09f86" vueId="14f953c0-1"></modal-black-list>
3 | <view class="_article-top data-v-4ba09f86">
> 4 | <link-button bind:__l="__l" class="data-v-4ba09f86" params="{{desc:1,note:'请输入搜索内容'}}" url="search"
| ^
5 | vueId="14f953c0-2" vueSlots="{{['default']}}">
6 | <search bind:__l="__l" class="data-v-4ba09f86" vueId="{{'14f953c0-3'+','+'14f953c0-2'}}"></search>
7 | </link-button>
at files://u_pages/article/index.wxml#4
你好。我这个是什么问题呢
这个问题是真的坑😂半年没动过的老代码,打开就报错了,还要一个个文件把*都删掉
这个不行啊 大兄弟
截图看看什么提示
这个更好解决,删除那个*号即可
Bad attr `
> 1 | <mescroll-uni vue-id="0c42b891-1" up="{{upOption}}" down="{{downOption}}" data-event-opts="{{[['^init',[['mescrollInit']]],['^down',[['downCallback']]],['^up',[['upCallback']]]]}}" bind:init="__e" bind:down="__e" bind:up="__e" bind:__l="__l" vue-slots="{{['default']}}"><view class="cu-bar bg-white search" :style="{{'top:'+(CustomBar+'px')+';'}}"><block wx:if="{{$root.g0>1}}"><picker style="padding-left:20rpx;" mode="selector" range="{{queryList}}" range-key="queryName" value="{{queryIndex}}" data-event-opts="{{[['change',[['queryChange',['$event']]]]]}}" bindchange="__e"><view><image style="width:20rpx;height:33rpx;" src="../../static/center/to.png"></image></view></picker></block><block wx:if="{{queryIndex==0}}"><view class="search-form round"><text class="cuIcon-search"></text><input type="text" placeholder="课程名称" data-event-opts="{{[['input',[['__set_model',['$0','kechengmingcheng','$event',[]],['searchForm']]]]]}}" value="{{searchForm.kechengmingcheng}}" bindinput="__e"/></view></block><block wx:if="{{queryIndex==1}}"><view class="search-form round"><text class="cuIcon-search"></text><input type="text" placeholder="课程类型" data-event-opts="{{[['input',[['__set_model',['$0','kechengleixing','$event',[]],['searchForm']]]]]}}" value="{{searchForm.kechengleixing}}" bindinput="__e"/></view></block><view class="action"><button data-event-opts="{{[['tap',[['search',['$event']]]]]}}" class="cu-btn bg-gradual-green shadow-blur round" bindtap="__e">搜索</button></view></view><scroll-view class="tabView" :style="{{'padding:'+('8rpx 0')+';'+('box-shadow:'+('0 0 12rpx rgba(255,0,0,0)')+';')+('margin:'+('0')+';')+('border-color:'+('rgba(0,0,0,1)')+';')+('background-color:'+('#e2e2e2')+';')+('border-radius:'+('0')+';')+('border-width:'+('0')+';')+('width:'+('100%')+';')+('border-style:'+('solid')+';')+('height:'+('auto')+';')}}" scroll-x="true"><block wx:for="{{categoryList}}" wx:for-item="item" wx:for-index="index" wx:key="index"><view data-event-opts="{{[['tap',[['categoryClick',['$0'],[[['categoryList','',index,'kechengleixing']]]]]]]}}" class="{{['tab',categoryName===item.kechengleixing?'tabActive':'']}}" :style="{{(categoryName===item.kechengleixing?{'padding':'0 28rpx','boxShadow':'0 0 12rpx rgba(0,0,0,.3)','margin':'0 12rpx','borderColor':'rgba(0,0,0,1)','backgroundColor':'#333','color':'#fff','borderRadius':'8rpx','borderWidth':'0','width':'auto','lineHeight':'68rpx','fontSize':'28rpx','borderStyle':'solid'}:{'padding':'0 20rpx','boxShadow':'0 0 12rpx rgba(0,0,0,.3)','margin':'0 12rpx','borderColor':'rgba(0,0,0,1)','backgroundColor':'#fff','color':'#333','borderRadius':'8rpx','borderWidth':'0','width':'auto','lineHeight':'68rpx','fontSize':'28rpx','borderStyle':'solid'})}}" bindtap="__e">{{item.kechengleixing}}</view></block></scroll-view><view class="uni-product-list" :style="{{'border-radius:'+(0)+';'+('background-color:'+('#efefef')+';')}}"><block wx:for="{{$root.l0}}" wx:for-item="product" wx:for-index="index" wx:key="index"><view data-event-opts="{{[['tap',[['onDetailTap',['$0'],[[['list','',index]]]]]]]}}" class="uni-product" :style="{{'border-radius:'+('8rpx')+';'+('background-color:'+('#fff')+';')}}" bindtap="__e"><view class="uni-product-title" :style="{{'font-size:'+('28rpx')+';'+('line-height:'+('56rpx')+';')+('color:'+('#333')+';')+('text-align:'+('left')+';')}}">{{product.$orig.kechengmingcheng}}</view><view class="image-view"><image class="uni-product-image" :style="{{'border-radius:'+('8rpx')+';'+('width:'+('100%')+';')+('height:'+('100%')+';')}}" mode="aspectFill" src="{{product.$orig.fengmian?product.g1[0]:''}}"></image></view><view style="display:flex;justify-content:space-between;"><block wx:if="{{$root.m0}}"><text data-event-opts="{{[['tap',[['onUpdateTap',['$0'],[[['list','',index,'id']]]]]]]}}" class="cuIcon-edit" catchtap="__e">修改</text></block><block wx:if="{{$root.m1}}"><text data-event-opts="{{[['tap',[['onDeleteTap',['$0'],[[['list','',index,'id']]]]]]]}}" class="cuIcon-delete" catchtap="__e">删除</text></block></view></view></block></view><block wx:if="{{$root.m2}}"><button data-event-opts="{{[['tap',[['onAddTap']]]]}}" class="add-btn" bindtap="__e">新增</button></block></mescroll-uni>
| ^
at files://pages/kechengxinxi/list.wxml#1(env: Windows,mp,1.06.2209190; lib: 2.30.1)
看看我这个是什么错误,老铁