airyland / vux

Mobile UI Components based on Vue & WeUI
https://vux.li
MIT License
17.59k stars 3.71k forks source link

[Bug Report] @on-shadow-change事件,没有手动滑动就触发了 #3151

Open lqins opened 6 years ago

lqins commented 6 years ago

VUX version

2.9.2

OS/Browsers version

win10

Vue version

2.5.17

Code

<popup-picker title="所在城市" :data="cityArr" :columns="3" v-model="value4" show-name placeholder="选择城市" @on-shadow-change="onShadowChange" class="chooseCity" @on-show="onShow" @on-hide="onHide" ></popup-picker>

     onShadowChange(val,city){
        // console.log('选中的值', name[0],name[1],name[2])
        console.log('选中的值1', city[0],city[1],city[2])
        console.log('选中的值2', val[0],val[1],val[2])
        this.province_id = val[0]
        this.area_id = val[1]
        //this.getRegionsData()
        // if(this.godown== true){
        //   this.getRegionsData()
        // }else{
        //   return
        // }
      },

Steps to reproduce

onShadowChange 事件没有写在任何生命周期内触发

在created加载数组cityArr时,onShadowChange 没有点击自己触发。而且在onShadowChange事件里边加载方法会一直执行,导致浏览器崩溃 一直在打印东西

What is Expected?

点开后滑动pick时,触发@onShadowChange事件

What is actually happening?

未点开未滑动,一直循环触发@onShadowChange事件

lqins commented 6 years ago

好方啊,我这个三级联动是反查找的,酱紫一直死循环不造肿么办好