From b26e2e5e041add1998fafc655bc55d6c77bfa1d7 Mon Sep 17 00:00:00 2001 From: lillillli <1724344500@qq.com> Date: Thu, 7 Apr 2022 16:39:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=B8=83=E5=B1=80=20?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E6=BB=9A=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/home.vue | 66 +++++++++++++++++++++++++++++++++++----------- 1 file changed, 50 insertions(+), 16 deletions(-) diff --git a/src/views/home.vue b/src/views/home.vue index 86cf5c6..4f04ff5 100644 --- a/src/views/home.vue +++ b/src/views/home.vue @@ -79,11 +79,14 @@
-{ this.$tv.reset(); this.$tv.focusClassName = "box_focusable"; // 选中的class - // this.$tv.init({ distanceToCenter: true }); // 焦点居中 + // this.$tv.init({ distanceToCenter: true }); // 焦点居中 // this.$tv.setScrollEl(document.querySelector(".home_nav")); // 设置滚动的div // this.$tv.setScrollEl(this.$tv.getElementByPath('//div[@class="nav_li"]')); // 初始化div聚焦 }); @@ -227,7 +239,7 @@ export default { } this.active = index; this.$tv.requestFocus(document.querySelector(`.tab_nav_${index + 1}`)); - // console.log(this.active); + // console.log(this.active); }, navLeft(index) { @@ -237,7 +249,7 @@ export default { this.active = index; this.$tv.requestFocus(document.querySelector(`.tab_nav_${index - 1}`)); } - // console.log(event.target, "left"); + // console.log(event.target, "left"); console.log(this.active); }, @@ -256,6 +268,24 @@ export default { false ); }, + + mationFocus(index) { + //切换滚动元素到menu + this.state = index; + this.$tv.setScrollEl( + this.$refs.box_section + // this.$tv.getElementByPath("//div[@class='box_section']") + ); + }, + + mationDown(i, event) { + //在最下面一个menu按下,焦点不动,避免右边内容item自动聚焦 + if (i == this.infoData.length) { + this.$tv.requestFocus(event.target); + } + console.log(event.target); + console.log("111"); + }, }, }; @@ -286,7 +316,7 @@ p { transform: scale(1.04); box-sizing: border-box; overflow: hidden; - border: solid #FFA564; + border: solid #ffa564; } // 轮播图 @@ -320,10 +350,10 @@ ul { color: #798190; font-size: 18px; display: flex; -} -li { - width: 148px; - text-align: center; + li { + width: 148px; + text-align: center; + } } .nav_li { @@ -339,12 +369,7 @@ li { margin: 0; height: 511px; } -.information { - display: flex; - align-items: center; - height: 67px; - margin-bottom: 16px; -} + .scenic { position: relative; width: 300px; @@ -380,10 +405,19 @@ li { height: 221px; box-sizing: border-box; padding: 16px; - overflow-y: hidden; border-radius: 10px; background: linear-gradient(180deg, #163d7e 0%, #1d3256 100%); + + .information { + width: 100%; + height: 67px; + display: flex; + align-items: center; + margin-bottom: 16px; + box-sizing: border-box; + } } + figure { width: 118px; height: 172px;