[Improvement] Tabs: use touchend event to handle swipe (#695)

This commit is contained in:
张敏
2018-03-15 14:13:26 +08:00
committed by neverland
parent 5cdf3b1d79
commit e366e033ed
2 changed files with 32 additions and 27 deletions

View File

@@ -147,12 +147,15 @@ describe('Tabs', () => {
wrapper.vm.$nextTick(() => {
triggerTouch(tabContent, 'touchstart', 0, 0);
triggerTouch(tabContent, 'touchmove', -100, 0);
triggerTouch(tabContent, 'touchend', 0, 0);
setTimeout(() => {
expect(tabsContainer.vNode.child.curActive).to.equal(1);
triggerTouch(tabContent, 'touchstart', 0, 0);
triggerTouch(tabContent, 'touchmove', 100, 0);
triggerTouch(tabContent, 'touchend', 0, 0);
setTimeout(() => {
expect(tabsContainer.vNode.child.curActive).to.equal(0);
done();