古力
古力
  • 发布:2019-09-26 17:19
  • 更新:2019-10-13 15:56
  • 阅读:548

【报Bug】HBuilderX2.3.X的在本页面无法传递值的BUG

分类:HBuilderX
<template>  
    <view class="content">  
        <view class="text-area" v-for="(value,id) in testv" :key="value.id" @tap="testf(value)">  
            <image class="logo" src="/static/logo.png"></image>  
        </view>  
    </view>  
</template>  
<script>  
    export default {  
        data() {  
            return {  
                title: 'Hello',  
                testv:{}  
            }  
        },  
        onLoad() {  
            this.testv = [  
                {id:'abc1',b:'cde1'},  
                {id:'abc2',b:'cde2'},  
                ]  
        },  
        methods: {  
            testf(e){  
                console.log(JSON.stringify(e));  
                console.log(e.id);  
            }  

        }  
    }  
</script>  

<style>  
    .content {  
        display: flex;  
        flex-direction: column;  
        align-items: center;  
        justify-content: center;  
    }  

    .logo {  
        height: 200rpx;  
        width: 200rpx;  
        margin-top: 200rpx;  
        margin-left: auto;  
        margin-right: auto;  
        margin-bottom: 50rpx;  
    }  

    .text-area {  
        display: flex;  
        justify-content: center;  
        border: #007AFF;  
        border-width: 1px;  
    }  

</style>

2.2.2版本运行一切正常,升级到2.3.X版本之后就报错

17:14:02.095 undefined at pages\index\index.vue:25
17:14:02.116 thirdScriptError
17:14:02.136 undefined is not an object (evaluating 'e.id'); [Component] Event Handler Error @ pages/index/index#handleEvent
17:14:02.157 testf
17:14:02.177 testf@[native code]
17:14:02.218 forEach@[native code]
17:14:02.259 forEach@[native code]
17:14:02.280 handleEvent
17:14:02.300 safeCallback
17:14:02.341 __hookEvent
17:14:02.423 n
17:14:02.443 subscribeHandler
17:14:02.505 pe
17:14:02.546 consume
17:14:02.566 map@[native code]

2019-09-26 17:19 负责人:无 分享
已邀请:
古力

古力 (作者)

你们2.3版本没有这个问题么?

  • GUNDAM

    干嘛不直接申明为数组

    2019-10-13 14:36

古力

古力 (作者)

声明数组是一样的错误,这个错误2.2版本没有,只是在2.3版本出现了

该问题目前已经被锁定, 无法添加新回复