123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- <template>
- <nav class="channel_nav">
- <a class="channel_nav_head_name" href="javascript:(void)" title="title">{{ title }}</a>
- <div class="channel_nav_a_box">
- <NuxtLink v-for="(item, index) in titleData"
- :to="{ path: `/${item.aLIas_pinyin}/list-1.html` }" class="channel_nav_a">{{ item.alias
- }}</NuxtLink>
- </div>
- </nav>
- </template>
- <script setup>
- //1.设置组件数据 start---------------------------------------->
- //子导航
- const props = defineProps({
- titleData: Array,
- pinyinid: Number
- });
- //获取当前url路径
- const route = useRoute();
- //获得当前的完整路径
- const fullPath = route.path;
- const segments = fullPath.split('/');
- const targetSegment = segments[1];
- //1.设置组件数据 end---------------------------------------->
- //2.设置组件标题 start ---------------------------------------->
- const title = ref("")
- async function getPageData() {
- const mkdata = await requestDataPromise('/web/getOneWebsiteCategory', {
- method: 'GET',
- query: {
- 'catid': props.pinyinid,
- },
- });
- if (mkdata.code == 200) {
- title.value = mkdata.data.alias;
- } else {
- console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
- console.log("错误位置:获取二级标题")
- console.log("后端错误反馈:", mkdata.message)
- console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
- }
- }
- getPageData();
- //2.设置组件标题 end ---------------------------------------->
- </script>
- <style lang="less" scoped>
- .channel_nav {
- width: 1200px;
- margin: 0 auto;
- border-bottom: solid 3px #004564;
- margin-top: 30px;
- display: flex;
- overflow: hidden;
- .channel_nav_head_name {
- margin: auto 2px 0px 0px;
- height: 44px;
- line-height: 44px;
- font-size: 30px;
- color: #fff;
- font-weight: bold;
- background: url(@/public/img/27.png) no-repeat right 0px;
- background-size: 100% 102%;
- padding: 0px 33px;
- box-sizing: border-box;
- }
- .channel_nav_a_box {
- flex: 1;
- margin-top: auto;
- overflow: hidden;
- }
- .channel_nav_a {
- float: left;
- height: 24px;
- line-height: 24px;
- color: #333;
- font-size: 18px;
- margin: 3px 10px 7px;
- font-weight: bold;
- // width: 88px;
- box-sizing: border-box;
- text-align: center;
- }
- .channel_nav_a:nth-of-type(10n) {
- margin-right: 0px;
- }
- }
- .back100 {
- background-size: 100% 100%;
- background-repeat: no-repeat;
- }
- </style>
|