1.vue 1.7 KB

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