picker icon indicating copy to clipboard operation
picker copied to clipboard

refill方法无法数据填充。

Open huoyuhengCat opened this issue 7 years ago • 2 comments

直接报Cannot read property '0' of undefined。还有因为用的angular,很难和你另外那个VUE picker插件结合。 代码如下: ngOnInit(){ //界面初始化 this.picker=new Picker({ data: [[{text:1,value:1}]], title: "选择阈值", selectedIndex: [0]
}) } selectPicker(i){ //点击后的回调 let newData=[[{text:2,value:12}]] this.picker.refill(newData); this.picker.show(); console.log(this.picker.data) }

huoyuhengCat avatar Oct 25 '17 06:10 huoyuhengCat

    this.picker.show(()=>{
        this.picker.refillColumn(0, [{text:'1',value:'1'}]);
    });

ff0x5f avatar Nov 03 '17 07:11 ff0x5f

个人的看法是refillColumn 和 refill 方法是必须在数据已经初始化过一次以后才行,就是你先睡意渲染次数据,然后再填充。从方法的名字看起来,也是指再次填充,而不是初始化的意思。

luyouxin84 avatar Dec 26 '17 09:12 luyouxin84