home.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <template>
  2. <div>
  3. <help-header></help-header>
  4. <div id="main">
  5. <div class="container" style="padding: 0; width: 1190px;">
  6. <div style="display: inline-block; width: 100%; margin: 0 auto">
  7. <div class="left">
  8. <left></left>
  9. </div>
  10. <div class="right">
  11. <div class="help-center">
  12. <div class="help-head"><img src="/images/help/help-title.png"></div>
  13. <div class="help-center-title">
  14. <a style="font-size: 14px" v-bind:href="'/help/home'">帮助中心首页</a>
  15. </div>
  16. <div class="help-center-home">
  17. <div v-for="nav01 in helpNav">
  18. <h4 v-text="nav01.item"></h4>
  19. <div class="row">
  20. <div v-for="nav02 in nav01.children">
  21. <em></em><nuxt-link :to="`/help/helpList/${nav02.id}`" v-text="nav02.item"></nuxt-link>
  22. </div>
  23. </div>
  24. </div>
  25. </div>
  26. </div>
  27. </div>
  28. </div>
  29. </div>
  30. </div>
  31. </div>
  32. </template>
  33. <script>
  34. // 升序
  35. function compare (property) {
  36. return function (a, b) {
  37. var value1 = a[property]
  38. var value2 = b[property]
  39. return value1 - value2
  40. }
  41. }
  42. import { left, helpHeader } from '~components/help'
  43. export default {
  44. name: 'help',
  45. components: {
  46. left,
  47. helpHeader
  48. },
  49. fetch ({ store }) {
  50. return Promise.all([
  51. store.dispatch('loadHelpSnapsho', { parentId: 0 })
  52. ])
  53. },
  54. computed: {
  55. helpNav () {
  56. let list = this.$store.state.help.snapsho.data.sort(compare('detno'))
  57. if (list) {
  58. for (let i = 0; i < list.length; i++) {
  59. list[i].children = list[i].children.sort(compare('detno'))
  60. }
  61. }
  62. return list
  63. }
  64. }
  65. }
  66. </script>
  67. <style>
  68. @import '~assets/scss/help.css';
  69. </style>