Skip to content

v-for内v-if元素内的filter报错 #2011

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

Closed
Dizzy-zz opened this issue Aug 13, 2020 · 1 comment
Closed

v-for内v-if元素内的filter报错 #2011

Dizzy-zz opened this issue Aug 13, 2020 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@Dizzy-zz
Copy link

Dizzy-zz commented Aug 13, 2020

问题描述
在v-for循环内,v-if的元素里面使用filter编译报错
[Vue warn]: Error in render: "TypeError: Cannot read property 'type' of undefined"
Cannot read property 'type' of undefined

复现步骤

<view v-for="item in list" :key="item.type">
      <template v-if="item.type === 1">
        <view>{{item.type | test}}</view>
      </template>
</view>

[或者可以直接贴源代码]

预期结果
正常的编译

实际结果
控制台报错
[Vue warn]: Error in render: "TypeError: Cannot read property 'type' of undefined"
Cannot read property 'type' of undefined
元素无法显示

系统信息:

  • 发行平台: 支付宝小程序
  • 操作系统: Mac10.15.6 支付宝小程序开发工具
  • HBuilderX版本: 2.8.5
  • uni-app版本:2.0.0-28520200811001

补充信息
[可选]
[根据你的分析,出现这个问题的原因可能在哪里?]

@pizriw
Copy link

pizriw commented Aug 15, 2020

原来是编译器bug 找了半天原因

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