Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v3编译block中使用v-for失效 #1206

Closed
jin-yufeng opened this issue Jan 1, 2020 · 3 comments
Closed

v3编译block中使用v-for失效 #1206

jin-yufeng opened this issue Jan 1, 2020 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@jin-yufeng
Copy link

问题描述

<template>
  <view>
    <block v-for="(item, index) in arr" v-bind:key="index">
      {{item}}
    </block>
  </view>
</template>
<script>
  export default {
    data() {
      return {
        arr: [1,2,3]
      }
    }
  }
</script>

通过 v3 版本编译上述代码的 APP,显示空白

系统信息:

  • 发行平台::APP
  • HBuilderX版本:2.5.0(v3)
@fxy060608 fxy060608 self-assigned this Jan 2, 2020
@fxy060608 fxy060608 added the bug Something isn't working label Jan 2, 2020
@jin-yufeng
Copy link
Author

@fxy060608
2.5.1(v3) 上面那样可以了,下面这样依然是空白

<template>
  <view>
    <block v-for="(item,index) in arr" v-bind:key="index">
      <block v-if="item==3">{{item}}</block>
    </block>
  </view>
</template>
<script>
  export default {
    data() {
      return {
        arr: [1,2,3]
      }
  }
}
</script>

v-forblock 换成 view 就可以

@Wangyaqi
Copy link
Contributor

此问题已修复

@jin-yufeng
Copy link
Author

@fxy060608
这样又空白了(2.6.15 v3)

<template>
  <view>
    <block v-for="(item, index) in arr" v-bind:key="index">
			<view v-if="item == 0">1</view>
			<block v-else-if="item == 1">2</block>
    </block>
  </view>
</template>
<script>
  export default {
    data() {
      return {
        arr:[1]
      }
  }
}
</script>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants