left.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. <template>
  2. <div class="help-list">
  3. <h2>帮助中心</h2>
  4. <!--<ul class="list-unstyled" style="margin-top: 10px;">
  5. <li v-for="nav01 in helps">
  6. <a :class="{'cur': nav01.isHide}" @click="toggleNav(nav01)"><span>{{nav01.item}}</span></a>
  7. <ul class="list-unstyled list-body" v-if="!nav01.isHide">
  8. <li v-for="nav02 in nav01.children">
  9. <nuxt-link :to="`/help/helpList/${nav02.id}`"><span v-text="nav02.item"></span></nuxt-link>
  10. </li>
  11. </ul>
  12. </li>
  13. </ul>-->
  14. <el-tree :data="helps" :props="defaultProps" :highlight-current="true" default-expand-all @node-click="openList"></el-tree>
  15. </div>
  16. </template>
  17. <script>
  18. export default {
  19. name: 'left',
  20. data () {
  21. return {
  22. defaultProps: {
  23. children: 'children',
  24. label: 'item'
  25. }
  26. }
  27. },
  28. computed: {
  29. helps () {
  30. return this.$store.state.help.snapsho.data
  31. }
  32. },
  33. methods: {
  34. openList (data) {
  35. if (data.level !== 1) {
  36. this.$router.push({ name: 'help-helpList-id', params: { id: data.id } })
  37. }
  38. }
  39. }
  40. }
  41. </script>
  42. <style>
  43. .el-tree{
  44. border: none;
  45. min-height: 300px;
  46. }
  47. .el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content,.el-tree-node:hover{
  48. background: none !important;
  49. }
  50. .el-tree-node__content:hover{
  51. background: none !important;
  52. }
  53. .el-tree-node__content:hover span{
  54. color: #5078cb;
  55. }
  56. .el-pagination .el-pager li.active{
  57. background-color: #5078cb;
  58. border-color: #337ab7;
  59. }
  60. .el-tree-node__expand-icon{
  61. font-family: "iconfont" !important;
  62. font-size: 14px;
  63. font-style: normal;
  64. -webkit-font-smoothing: antialiased;
  65. width: inherit;
  66. height: inherit;
  67. border: inherit;
  68. font-weight: bold;
  69. text-shadow: -1px 0px 0 #333;
  70. margin-right: 3px !important;
  71. }
  72. .el-tree-node__content{
  73. line-height: 30px;
  74. height: 30px;
  75. }
  76. .el-tree-node__expand-icon.is-leaf{
  77. visibility: hidden;
  78. }
  79. .el-tree-node__expand-icon:before{
  80. content: "\E621";
  81. }
  82. .help-list{
  83. width: 200px;
  84. background: #fff;
  85. border: #e8e8e8 1px solid;
  86. }
  87. .help-list h2{
  88. background: #5078cb;
  89. line-height: 34px;
  90. height: 34px;
  91. color: #fff;
  92. font-size: 14px;
  93. text-align: center;
  94. margin: 0;
  95. }
  96. .help-list ul{
  97. width: 200px;
  98. display: inline-block;
  99. }
  100. .help-list li {
  101. position: relative;
  102. line-height: 33px;
  103. font-size: 14px;
  104. color: #333;
  105. float: left;
  106. width: 100%;
  107. padding-left: 10px;
  108. }
  109. .help-list li a {
  110. display: block;
  111. padding-left: 15px;
  112. text-decoration: none;
  113. color: #333;
  114. }
  115. .help-list li a:hover{
  116. color: #5078cb;
  117. cursor: pointer;
  118. }
  119. .help-list ul.list-body {
  120. /*display: none;*/
  121. color: #666;
  122. }
  123. .help-list ul.list-body.active {
  124. display: block;
  125. }
  126. .help-list ul.list-body li {
  127. float: none;
  128. background-image: none;
  129. min-height: 26px;
  130. line-height: 26px;
  131. font-size: 12px;
  132. }
  133. .help-list ul.list-body li a {
  134. padding-left: 15px;
  135. display: block;
  136. color: rgb(50,50,50);
  137. background: none;
  138. }
  139. .help-list ul.list-body li a:hover {
  140. color: #5078cb;
  141. cursor: pointer;
  142. }
  143. .help-list ul.list-body li a.cur,.help-list ul li a.cur{
  144. text-decoration: none;
  145. font-size: 14px;
  146. }
  147. .help-list .operate-icon {
  148. position: absolute;
  149. right: 20px;
  150. top: 1px;
  151. }
  152. .help-list li>ul>li>ul>li {
  153. padding-left: 30px;
  154. }
  155. </style>