Browse Source

修改布局 切换滚动

master
lillillli 3 years ago
parent
commit
b26e2e5e04
  1. 54
      src/views/home.vue

54
src/views/home.vue

@ -79,11 +79,14 @@
</p>
</div>
<div class="box_section box_5" v-focusable>
<div class="box_section box_5" ref="box_section">
<div
class="information"
v-for="(item, index) in infoData"
:key="index"
@onFocus="mationFocus(item.index, $event)"
@down="mationDown(item.index, $event)"
v-focusable
>
<p
style="
@ -160,6 +163,7 @@ export default {
data() {
return {
active: 0,
state: 0,
navData: [
{ name: "首页", index: 0 },
{ name: "农民夜校", index: 1 },
@ -171,14 +175,22 @@ export default {
],
infoData: [
{
index: 0,
info: "近日,剑阁县龙源镇纪委联合镇疫情防控领导专班深入场镇干单位、村(社区)开展疫...",
print: require("../assets/img/Rectangle2221.png"),
},
{
index: 1,
info: "近日,剑阁县龙源镇纪委联合镇疫情防控领导专班深入场镇干单位、村(社区)开展疫...",
print: require("../assets/img/Rectangle2221.png"),
},
{
index: 2,
info: "近日,剑阁县龙源镇纪委联合镇疫情防控领导专班深入场镇干单位、村(社区)开展疫...",
print: require("../assets/img/Rectangle2221.png"),
},
{
index: 3,
info: "近日,剑阁县龙源镇纪委联合镇疫情防控领导专班深入场镇干单位、村(社区)开展疫...",
print: require("../assets/img/Rectangle2221.png"),
},
@ -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) {
//menuitem
if (i == this.infoData.length) {
this.$tv.requestFocus(event.target);
}
console.log(event.target);
console.log("111");
},
},
};
</script>
@ -286,7 +316,7 @@ p {
transform: scale(1.04);
box-sizing: border-box;
overflow: hidden;
border: solid #FFA564;
border: solid #ffa564;
}
//
@ -320,11 +350,11 @@ ul {
color: #798190;
font-size: 18px;
display: flex;
}
li {
width: 148px;
text-align: center;
}
}
.nav_li {
background: url("../assets/img/ray.png");
@ -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;

Loading…
Cancel
Save