list.vue 2.83 KB
<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>