Andy2u
Andy2u
  • 发布:2024-12-05 14:59
  • 更新:2024-12-05 15:34
  • 阅读:247

【报Bug】[HBuilderX 4.36 ] 鸿蒙系统 picker组件的mode="multiSelector",直接闪退

分类:鸿蒙Next

产品分类: uniapp/App

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: win10

HBuilderX类型: 正式

HBuilderX版本号: 4.36

手机系统: HarmonyOS NEXT

手机系统版本号: HarmonyOS NEXT Developer Beta2

手机厂商: 华为

手机机型: 纯血鸿蒙

页面类型: vue

vue版本: vue3

打包方式: 离线

项目创建方式: HBuilderX

操作步骤:

点击picker组件的mode="multiSelector"组件,直接闪退

预期结果:

正常使用,数据能联动

实际结果:

直接闪退

bug描述:

昨天升级版本HBuilderX 4.36版本, 鸿蒙系统 picker组件的mode="multiSelector",直接闪退 其他系统都正常显示。
之前用的版本是HBuilderX 4.26版本,鸿蒙系统能正常显示,只是不能联动
代码如下:

<template>  
  <view class="pca-picker-cc">  
    <picker mode="multiSelector" @cancel="pickerClose()" @columnchange="bindMultiPickerColumnChange" @change="change" :value="multiIndexArr" :range="multiArray">  
      <slot></slot>  
    </picker>  
  </view>  
</template>  

<script>  
let _self;  
export default {  
  name: "pca-picker-cc",  
  // 此处定义传入的数据  
  props: {  
    addressList: {  
      type: Array,  
      default: []  
    },  
    resultDTO: {  
        type: Array,  
        default: []  
    },  
    isDefault:{ // 是否展示默认提示语  
      type: Boolean,  
      default: true  
    }  
  },  
  computed: {  
    multiIndexArr(){  
      return [this.provinceIndex, this.cityIndex, this.countyIndex];  
    },  
    province() {  
      return this.provinceList[this.provinceIndex] || {};  
    },  
    provinceList() {  
      return this.data;  
    },  
    provinceNameList() {  
      return this.provinceList.map((item, index) => item.text || '');  
    },  
    city() {  
      return this.cityList[this.cityIndex] || {};  
    },  
    cityList() {  
      return this.province.children || [];  
    },  
    cityNameList() {  
      return this.cityList.map((item, index) => item.text || '');  
    },  
    county() {  
      return this.countyList[this.countyIndex] || {};  
    },  
    countyList() {  
      return this.city.children || [];  
    },  
    countyNameList() {  
      return this.countyList.map((item, index) => item.text || '');  
    },  
    multiArray() {  
      return [this.provinceNameList, this.cityNameList, this.countyNameList];  
    },  
    addressResultObj() {  
      return {province: this.province, city: this.city, county: this.county};  
    },  
    addressResultList(){  
      return Object.values(this.addressResultObj).map((item, index) => item.text || '');  
    }  
  },  
  data() {  
    return {  
      data: [],  
     // resultDTO:[],  
      provinceIndex: 0,  
      cityIndex: 0,  
      countyIndex: 0,  
      keys: ['province', 'city', 'county'],  
      upDown:false,  
    };  
  },  
  //在实例创建完成后被立即调用。  
  mounted() {  
    _self = this;  
   _self.data = this.resultDTO;  
    if(_self.isDefault){  
      _self.init();  
    }  
  },  
  methods: {  
  // 获取数据  
  // async loadData() {  
    // const result = await this.$axios(this.$baseUrl.schooSelectAllRegion);  
    // this.resultDTO = fn.FuncUnzip(result.data.obj);  
    // console.log("resultDTO1", this.resultDTO)  
    // _self.data = this.resultDTO;  
    // console.log("_self.data:",this.resultDTO)  
    // _self.init();  
  // },  

    init() {  
      if (this.addressList.length === 3) {  
        let key, index;  
        for (let i in this.keys) {  
          key = this.keys[i];  
          index = this[`${key}NameList`].indexOf(this.addressList[i]);  
          if (index <= -1) {  
            index = 0;  
          }  
          this.$data[`${key}Index`] = index;  
        }  
        this.change();  
      }  
    },  
    bindMultiPickerColumnChange: function (e) {  
      let index = e.detail.column;  
      let key = this.keys[index];  
      this.$data[`${key}Index`] = e.detail.value;  
      while (index < this.keys.length) {  
        index++;  
        key = this.keys[index];  
        this.$data[`${key}Index`] = 0;  
      }  
    },  
    change(e){  
      // console.log(e)  
      this.$emit('update:addressList', this.addressResultList);  
      this.$emit('getAddressResultObj', this.addressResultObj);  
      this.$emit('pickerClose', this.upDown);  
    },  
    pickerClose(){  
        this.$emit('pickerClose', this.upDown);  
    }  
  }  
}  
</script>  

<style lang="scss">  

</style>  
2024-12-05 14:59 负责人:无 分享
已邀请:
DCloud_UNI_yuhe

DCloud_UNI_yuhe

你好,我这测试多列选择器是正常的,你可以提供一下一个可以复现的项目吗?

要回复问题请先登录注册