Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tab标签内,设置两个scroll其中有一个肯定不管用 #1337

Open
wudongkang opened this issue Apr 12, 2023 · 1 comment
Open

tab标签内,设置两个scroll其中有一个肯定不管用 #1337

wudongkang opened this issue Apr 12, 2023 · 1 comment

Comments

@wudongkang
Copy link

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
Copy link

1.给BS组件传入name
2.初始化BS组件时,采用传入的name. new BScroll(props.name, options)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants