1.vue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <template>
  2. <div :class="'menuStyle' + skinId">
  3. <div class="menuBoxBg">
  4. <div class="menuBox" ref="menuBox">
  5. <div>
  6. <NuxtLink
  7. href="/"
  8. title="首页"
  9. target="_self"
  10. >
  11. 首页
  12. </NuxtLink>
  13. </div>
  14. <div v-for="(item, index) in navigation" :key="index">
  15. <NuxtLink
  16. :href="getLinkPath(item)"
  17. :title="item.alias"
  18. :target="item.is_url == 1 ? '_blank' : '_self'"
  19. >
  20. {{ item.alias }}
  21. </NuxtLink>
  22. </div>
  23. </div>
  24. </div>
  25. </div>
  26. </template>
  27. <script setup>
  28. //1.1 pinia
  29. import { useTemplateBaseStore } from '@/stores/templateBase'
  30. const templateBaseStore = useTemplateBaseStore()
  31. //获得皮肤id
  32. const skinId = ref("")
  33. skinId.value = templateBaseStore.webSiteInfo.website_foot.foot_info.template_id;
  34. //1.获取导航菜单 start ---------------------------------------->
  35. //第一行导航菜单 10个
  36. const navigation = ref([]);
  37. //获取导航菜单1
  38. async function getNavigation() {
  39. const mkdata = await requestDataPromise('/web/getWebsiteModelCategory', {
  40. method: 'GET',
  41. query: {
  42. 'pid': 0,
  43. 'num': 23,
  44. 'placeid': 1
  45. },
  46. });
  47. navigation.value = mkdata.data;
  48. }
  49. getNavigation();
  50. //1.获取导航菜单 end ---------------------------------------->
  51. </script>
  52. <style lang="less" scoped>
  53. @import url('@/assets/css/public/template/nav.less');
  54. </style>