From a8ecb30cab1c22a84e4e2c44b102257c8e2f778c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=87=AA=E5=B8=A6=E5=A4=A7=E4=BD=AC=E6=B0=94=E5=9C=BA?=
<188633308@qq.com>
Date: Wed, 26 May 2021 18:09:25 +0800
Subject: [PATCH] =?UTF-8?q?update=20=E6=9B=B4=E6=8D=A2=E6=A0=91=E6=BB=9A?=
=?UTF-8?q?=E5=8A=A8=E6=9D=A1?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Web/src/assets/style/lib/tree-layout.less | 47 +++++++-------
Web/src/components/yoTreeLayout/index.js | 79 +++++------------------
2 files changed, 41 insertions(+), 85 deletions(-)
diff --git a/Web/src/assets/style/lib/tree-layout.less b/Web/src/assets/style/lib/tree-layout.less
index e1f3c1b..e5b2a10 100644
--- a/Web/src/assets/style/lib/tree-layout.less
+++ b/Web/src/assets/style/lib/tree-layout.less
@@ -27,28 +27,6 @@
}
}
}
- .swiper-container {
- position: absolute;
- top: @layout-header-height;
- left: 0;
- bottom: 0;
-
- width: 100%;
- .swiper-slide {
- height: auto;
- min-height: 100%;
- }
- .swiper-scrollbar {
- transition: @animation-duration-slow opacity;
-
- opacity: 0;
- }
- &:hover {
- .swiper-scrollbar {
- opacity: 1;
- }
- }
- }
}
&--bar {
line-height: 20px;
@@ -66,4 +44,29 @@
}
}
}
+ &--content {
+ position: absolute;
+ top: @layout-header-height;
+ left: 0;
+ bottom: 0;
+
+ overflow-y: auto;
+
+ width: 100%;
+ &::-webkit-scrollbar {
+ width: 5px;
+ height: 5px;
+
+ background-color: @white;
+ }
+ &::-webkit-scrollbar-thumb {
+ background-color: transparent;
+ }
+ &:hover::-webkit-scrollbar-thumb {
+ background-color: fade(@black, 30%);
+ }
+ &::-webkit-scrollbar-thumb:active {
+ background-color: fade(@black, 45%);
+ }
+ }
}
diff --git a/Web/src/components/yoTreeLayout/index.js b/Web/src/components/yoTreeLayout/index.js
index fdd4932..24b88a8 100644
--- a/Web/src/components/yoTreeLayout/index.js
+++ b/Web/src/components/yoTreeLayout/index.js
@@ -1,6 +1,4 @@
-import Swiper from 'swiper'
-
-let timer, swiper
+let timer
export default {
props: {
@@ -45,28 +43,6 @@ export default {
this.onLoadData()
},
- mounted() {
- const container = this.$refs.swiper,
- scrollBar = container.querySelector('.swiper-scrollbar')
-
- const swiperOptions = {
- direction: 'vertical',
- slidesPerView: 'auto',
- freeMode: true,
- scrollbar: {
- el: scrollBar,
- },
- mousewheel: true,
- }
-
- swiper = new Swiper(container, swiperOptions)
-
- window.addEventListener('resize', () => {
- this.onUpdateSwiper()
- })
-
- },
-
methods: {
renderBreadcrumbItem() {
@@ -114,10 +90,6 @@ export default {
this.expandedKeys = this.list.map(p => p.key)
}
this.data = data
-
- this.$nextTick(() => {
- this.onUpdateSwiper()
- })
}).finally(() => {
this.loading = false
})
@@ -130,7 +102,6 @@ export default {
onExpand(expandedKeys) {
this.expandedKeys = expandedKeys
this.autoExpandParent = false
- this.onUpdateSwiper()
},
onUnexpandAll() {
@@ -150,11 +121,6 @@ export default {
this.searchValue = value
this.expandedKeys = expandedKeys
this.autoExpandParent = true
-
- this.$nextTick(() => {
- this.onUpdateSwiper()
- })
-
},
onSelect(selectedKeys) {
@@ -167,14 +133,6 @@ export default {
this.$emit('select', selectedIds)
},
- onUpdateSwiper() {
- clearTimeout(timer)
- timer = setTimeout(() => {
- swiper.update()
- swiper.update()
- }, 300)
- },
-
generateKey(data, level) {
const n = level || [0]
n.push(0)
@@ -267,26 +225,21 @@ export default {
暂无数据
+ +