开放平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

223 lines
4.6 KiB

  1. <template>
  2. <div class="index-head-box">
  3. <div class="flex-item">
  4. <!-- 首页标题logo -->
  5. <div class="list-item-box1">
  6. <div class="item-img">
  7. <img src="@/static/img/head-title.png" alt="" />
  8. </div>
  9. <!-- 搜索 -->
  10. <div class="item-input">
  11. <el-input
  12. v-model="searchValue"
  13. size="mini"
  14. placeholder="输入关键词搜索"
  15. ></el-input>
  16. <div class="item-button">
  17. <div class="primary-button">搜索</div>
  18. </div>
  19. </div>
  20. <!-- 注册登陆按钮 -->
  21. <div class="button-box">
  22. <div class="head-left-button">
  23. <div class="primary-button2" @click="onLogin">登陆</div>
  24. </div>
  25. <div class="head-right-button">
  26. <div class="primary-button" @click="onSign">注册</div>
  27. </div>
  28. </div>
  29. </div>
  30. <div>
  31. <el-menu
  32. :default-active="activeIndex"
  33. class="el-menu-demo"
  34. mode="horizontal"
  35. @select="handleSelect"
  36. >
  37. <div
  38. class="menu-block"
  39. v-for="(item, index) in menuData"
  40. :key="index"
  41. >
  42. <el-menu-item :index="item.mark" v-if="!item.slot">{{
  43. item.title
  44. }}</el-menu-item>
  45. <el-submenu :index="item.mark" v-else>
  46. <template slot="title">{{ item.title }}</template>
  47. <el-menu-item
  48. v-for="(list, i) in item.chlid"
  49. :key="i"
  50. :index="list.mark"
  51. >{{ list.title }} {{ i }}</el-menu-item
  52. >
  53. </el-submenu>
  54. </div>
  55. </el-menu>
  56. </div>
  57. </div>
  58. </div>
  59. </template>
  60. <script>
  61. export default {
  62. name: "page-head",
  63. data() {
  64. return {
  65. searchValue: "",
  66. activeIndex: "",
  67. menuData: [
  68. {
  69. title: "方案解决",
  70. mark: "scheme",
  71. slot: true,
  72. chlid: [
  73. {
  74. title: "选项",
  75. mark: "scheme1",
  76. slot: false,
  77. },
  78. {
  79. title: "选项",
  80. mark: "scheme2",
  81. slot: false,
  82. },
  83. {
  84. title: "选项",
  85. mark: "scheme3",
  86. slot: false,
  87. },
  88. ],
  89. },
  90. {
  91. title: "应用市场",
  92. mark: "market",
  93. slot: false,
  94. },
  95. {
  96. title: "文档中心",
  97. mark: "document",
  98. slot: true,
  99. chlid: [
  100. {
  101. title: "选项",
  102. mark: "document1",
  103. slot: false,
  104. },
  105. {
  106. title: "选项",
  107. mark: "document2",
  108. slot: false,
  109. },
  110. {
  111. title: "选项",
  112. mark: "document3",
  113. slot: false,
  114. },
  115. ],
  116. },
  117. {
  118. title: "帮助支持",
  119. mark: "support",
  120. slot: true,
  121. chlid: [
  122. {
  123. title: "选项",
  124. mark: "support1",
  125. slot: false,
  126. },
  127. {
  128. title: "选项",
  129. mark: "support2",
  130. slot: false,
  131. },
  132. {
  133. title: "选项",
  134. mark: "support3",
  135. slot: false,
  136. },
  137. ],
  138. },
  139. {
  140. title: "开发者",
  141. mark: "developer",
  142. slot: false,
  143. },
  144. {
  145. title: "控制台",
  146. mark: "control",
  147. slot: false,
  148. },
  149. ],
  150. };
  151. },
  152. methods: {
  153. handleSelect: function () {},
  154. onLogin: function () {
  155. this.$router.push("/login");
  156. },
  157. onSign: function () {
  158. this.$router.push("/sign");
  159. },
  160. },
  161. };
  162. </script>
  163. <style lang="scss" scoped>
  164. .el-menu-demo {
  165. display: flex;
  166. }
  167. .index-head-box {
  168. height: 136px;
  169. width: 100vw;
  170. background: #fff;
  171. display: flex;
  172. box-sizing: border-box;
  173. justify-content: center;
  174. padding: 24px 0 20px;
  175. }
  176. .flex-item {
  177. width: 1200px;
  178. height: 100%;
  179. display: flex;
  180. flex-flow: column; //垂直排列
  181. justify-content: space-between; //两端对齐
  182. }
  183. .list-item-box1 {
  184. display: flex;
  185. }
  186. .item-input {
  187. width: 350px;
  188. height: 34px;
  189. box-sizing: border-box;
  190. border-radius: 6px;
  191. display: flex;
  192. background: #f7f8fa;
  193. margin: 0 auto;
  194. align-items: center;
  195. font-size: 14px;
  196. }
  197. .item-button {
  198. width: 70px;
  199. height: 100%;
  200. }
  201. .button-box {
  202. display: flex;
  203. }
  204. .head-left-button,
  205. .head-right-button {
  206. width: 70px;
  207. height: 34px;
  208. display: flex;
  209. }
  210. .head-left-button {
  211. margin-right: 9px;
  212. }
  213. </style>