index.vue 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <template>
  2. <div id="index">
  3. <el-row>
  4. <el-col :span="24" class="main">
  5. <el-col :span="24" class="top">
  6. <span v-if="active == 0">
  7. <question></question>
  8. </span>
  9. <span v-else-if="active == 1">
  10. <notice></notice>
  11. </span>
  12. <span v-else-if="active == 2">
  13. <news></news>
  14. </span>
  15. </el-col>
  16. <el-col :span="24" class="foot">
  17. <van-tabbar v-model="active" @change="chageAcieve">
  18. <van-tabbar-item icon="question-o">调查问卷</van-tabbar-item>
  19. <van-tabbar-item icon="info-o">通知通告</van-tabbar-item>
  20. <van-tabbar-item icon="label-o">新闻资讯</van-tabbar-item>
  21. <van-tabbar-item icon="manager-o">账号管理</van-tabbar-item>
  22. </van-tabbar>
  23. </el-col>
  24. </el-col>
  25. </el-row>
  26. </div>
  27. </template>
  28. <script>
  29. import question from './index/question.vue';
  30. import notice from './index/notice.vue';
  31. import news from './index/news.vue';
  32. import { mapState, createNamespacedHelpers } from 'vuex';
  33. export default {
  34. metaInfo() {
  35. return { title: this.$route.meta.title };
  36. },
  37. name: 'index',
  38. props: {},
  39. components: { question, notice, news },
  40. data: function() {
  41. return {
  42. active: 0,
  43. };
  44. },
  45. created() {},
  46. methods: {
  47. chageAcieve(index) {
  48. if (index == 3) this.$router.push({ path: '/account/index' });
  49. },
  50. },
  51. computed: {
  52. ...mapState(['user']),
  53. },
  54. watch: {},
  55. };
  56. </script>
  57. <style lang="less" scoped>
  58. .main {
  59. .foot {
  60. height: 50px;
  61. overflow: hidden;
  62. }
  63. }
  64. </style>