tabs组件支持滑动 (#52)
This commit is contained in:
@@ -92,6 +92,7 @@ export default {
|
||||
const supportTouch = !Vue.prototype.$isServer && 'ontouchstart' in window;
|
||||
const container = this.$refs.previewContainer;
|
||||
|
||||
/* istanbul ignore else */
|
||||
if (supportTouch) {
|
||||
let touchStartTime;
|
||||
|
||||
@@ -99,6 +100,7 @@ export default {
|
||||
touchStartTime = new Date();
|
||||
});
|
||||
container.addEventListener('touchend', () => {
|
||||
/* istanbul ignore else */
|
||||
if (new Date() - touchStartTime < 1500) {
|
||||
this.value = false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user