古力
古力
  • 发布:2019-11-12 21:05
  • 更新:2019-11-20 19:53
  • 阅读:630

【报Bug】HBuilderX2.3.以上版本无法在本页面内传递值

分类: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版本之后在APP和真机运行就报错,浏览器不报错。

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-11-12 21:05 负责人:无 分享
已邀请:
古力

古力 (作者)

报BUG也没人管,形同虚设

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