tab标签内,设置两个scroll其中有一个肯定不管用
Opened this issue · 1 comments
wudongkang commented
bs.value = new BScroll(wrapper.value, {
scrolly: true,
probeType: 3,
click: true,
pullDownRefresh: {
stop: 30,
threshold: 40,
},
// 动画
bounce: {
top: true,
bottom: true,
left: true,
right: true,
},
});
bs.value.on('scrollStart', () => {
console.log('scrollStart-');
// 完成下拉刷新事件,不写下次就没反应了
// bs1.value.finishPullDown();
});
bs.value.on('scroll', ({}) => {
console.log('scrolling-');
});
bs.value.on('scrollEnd', (pos) => {
console.log(pos);
});
// 重新计算bettercsroll 当数据变化dom变化的时候,必须要重新调用
bs.value.refresh();
// ---------------------------------------*****************// ---------------------------------------*************************
bs1.value = new BScroll(scroll.value, {
scrolly: true,
// specifiedIndexAsContent: 1,
probeType: 3,
click: true,
pullDownRefresh: {
stop: 30,
threshold: 40,
},
});
bs1.value.on('scrollStart', () => {
console.log('scrollStart-');
});
bs1.value.on('scroll', ({}) => {
console.log('scrolling-');
});
bs1.value.on('scrollEnd', (pos) => {
console.log(pos);
});
bs1.value.refresh();
如上代码。有两个tab切换只会生效1个
dh336699 commented
1.给BS组件传入name
2.初始化BS组件时,采用传入的name. new BScroll(props.name, options)