From c4e06f3055b983ebc12e65deadc6f15360b4a5b2 Mon Sep 17 00:00:00 2001 From: 陈峰 <348018533@qq.com> Date: Wed, 15 Nov 2017 14:27:39 +0800 Subject: [PATCH] Revert "品牌列表灵敏度" This reverts commit 2317447bab29dc22eb4d006b0537af30be9ef2b2 --- public/vue/channel/brand-list.vue | 55 ++----------------------------------------------------- 1 file changed, 2 insertions(+), 53 deletions(-) diff --git a/public/vue/channel/brand-list.vue b/public/vue/channel/brand-list.vue index 6562f80..e5591c8 100644 --- a/public/vue/channel/brand-list.vue +++ b/public/vue/channel/brand-list.vue @@ -4,7 +4,7 @@ <div class="index"><a :href="'#' + item.index" :id="item.index" :name="item.index">{{item.index}}</a></div> <div class="brand-big-box clearfix"> <div class="brand-box" v-for="brand in item.brands" :key="brand.name"> - <a v-brand-href="brand.domain" :class="hrefClass"> + <a v-brand-href="brand.domain"> <span class="brand-name">{{brand.name}}</span> </a> </div> @@ -110,7 +110,6 @@ import bus from 'common/vue-bus'; import tip from 'common/tip'; import indexList from 'component/tool/index-list.vue'; - import yoho from 'yoho'; export default { props: ['channel'], @@ -119,9 +118,6 @@ brandList: [], indexList: [], currentChannel: this.channel, - hrefClass: { - 'no-link': false - } }; }, watch: { @@ -158,43 +154,6 @@ } window.scrollTo(0, top); } - }, - touchmove() { - this.hrefClass['no-link'] = true; - }, - touchend() { - this.hrefClass['no-link'] = false; - }, - scrollEnd() { - this.hrefClass['no-link'] = false; - }, - getScrollEventTarget(element) { - let getComputedStyle = document.defaultView.getComputedStyle; - let currentNode = element; - - while (currentNode && currentNode.tagName !== 'HTML' && currentNode.tagName !== 'BODY' && currentNode.nodeType === 1) { - let overflowY = getComputedStyle(currentNode).overflowY; - - if (overflowY === 'scroll' || overflowY === 'auto') { - return currentNode; - } - currentNode = currentNode.parentNode; - } - return window; - }, - throttle(fn, delay) { - let timer; - - return () => { - if (timer) { - clearTimeout(timer); - timer = null; - } - this.hrefClass['no-link'] = true; - timer = setTimeout(() => { - fn(); - }, delay); - }; } }, components: { @@ -206,16 +165,6 @@ this.currentChannel = channel; this.getBrandList(); }); - }, - mounted() { - const $scrollEl = this.getScrollEventTarget(this.$el); - - if (yoho.isiOS) { - $scrollEl.addEventListener('touchmove', this.touchmove); - $scrollEl.addEventListener('touchend', this.touchend); - } else { - $scrollEl.addEventListener('scroll', this.throttle(this.scrollEnd, 200)); - } - }, + } }; </script> -- libgit2 0.24.0