list.vue
2.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
<template>
<div class="question_container">
<NafmHeader :title="$t('title.question')" navClass="nafmii-head-bg3"></NafmHeader>
<div class="question_content">
<van-sidebar v-model="activeKey" class="left_menu">
<van-sidebar-item v-for="(item,index) in menu" :key="index">
<template #title>
<img :src="item.icon">
<span>{{item.name}}</span>
</template>
</van-sidebar-item>
</van-sidebar>
<div class="right_content">
<div class="list_content">
<van-cell :title="item.title" center is-link v-for="(item,index) in list" @click="jumpDetail(item.id)" :key="index" />
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'Question',
data() {
return {
icon: require('@/assets/icon/question_icon.png'),
list: [
{ id: '1', type: '产品创新', title: '1问题一问题一问题一问题' },
{ id: '2', type: '产品创新', title: '2问题二问题二问题二问题' },
{ id: '2', type: '产品创新', title: '问题二问题二问题二问题二问题二问题二问题二问题二问题二问题二' },
],
menu: [{
icon: require('@/assets/icon/question_icon.png'),
name: '产品创新1',
id: 1.
}, {
icon: require('@/assets/icon/question_icon.png'),
name: '产品创新',
id: 1.
}, {
icon: require('@/assets/icon/question_icon.png'),
name: '产品创新',
id: 1.
}],
activeKey: 0
}
},
methods: {
jumpPage() {
this.$router.push({
name: 'Home'
})
},
// 跳转问题详情
jumpDetail(id) {
this.$router.push({
path: '/user/questionDetail',
query: {
id
}
})
}
}
}
</script>
<style lang="less" scoped>
@import "./less/index.less";
.question_container {
overflow-y: hidden;
height: 100%;
}
.question_content {
display: flex;
flex-direction: row;
height: calc(100vh - 41px);
}
/deep/ .van-sidebar-item {
width: 125px !important;
padding: 0;
height: 56px;
display: flex;
justify-content: center;
background-color: #f6f6f6;
}
/deep/ .van-sidebar-item__text {
display: flex;
align-items: center;
}
.left_menu {
height: 100%;
overflow-y: scroll;
width: 125px !important;
background-color: #f6f6f6;
img {
width: 18px;
height: 18px;
margin-right: 10px;
}
}
.right_content {
height: 100%;
overflow-y: scroll;
display: flex;
flex-direction: column;
flex: 1;
}
/deep/ .van-sidebar-item--select::before {
height: 29px;
width: 3px;
background-color: #135faa;
}
/deep/ .van-sidebar-item--select {
color: #135faa;
background-color: #fff;
}
.van-cell__title {
overflow: hidden;
text-overflow: ellipsis;
word-break: break-all;
white-space: nowrap;
}
</style>