Skip to content

[Bug]: wx:for with wx:if/wx:else #25

@iChenLei

Description

@iChenLei

To reproduce:

<view wx:if="{{showGoods}}" wx:for="{{goodsList}}" >{{item.name}}</view>
<block wx:else>
  <view wx:for="{{userList}}" >{{item.username}}</view>
</block>

workaround for this case:

<block wx:if="{{showGoods}}">
  <view wx:for="{{goodsList}}" >{{item.name}}</view>
</block>
<block wx:else>
  <view wx:for="{{userList}}" >{{item.username}}</view>
</block>

Current behavior:

No eslint problem hint, but get wechat miniprogram compile error

Bad attr `wx:else` with message: `wx:if not found, then something must be wrong`

Expected behavior:

lint this error

Environment information:

  • eslint version: v7
  • nodejs version: v14
  • eslint-plugin-wxml version: 0.5.0
  • your IDE/editor: VSCode

Metadata

Metadata

Assignees

Labels

questionFurther information is requested

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions