123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122 |
- <template>
- <main class="index_main">
- <nav class="channel_nav clearfix">
- <a class="channel_nav_a_head" href="javascript:(void)" :title="title">{{ title }}</a>
- <div class="channel_nav_right clearfix">
- <NuxtLink :to="{ path: `/${item.aLIas_pinyin}/list-1.html` }" class="channel_nav_a"
- v-for="(item, index) in titleData" :key="index">
- {{ item.alias }}
- </NuxtLink>
- </div>
- </nav>
- </main>
- </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 {
- background: #A91B33;
- margin: 30px auto 0px;
- position: relative;
- z-index: 11;
- display: flex;
- .channel_nav_a_head {
- word-break: keep-all;
- white-space: nowrap;
- display: block;
- background: #fff;
- border-top-left-radius: 7px;
- border-top-right-radius: 7px;
- position: relative;
- z-index: 22;
- font-size: 16px;
- font-weight: bold;
- height: 51px;
- line-height: 42px;
- color: #A91B33;
- margin: auto 21px 0px 35px;
- padding: 0px 40px;
- }
- .channel_nav_a_head::before {
- content: '';
- display: block;
- position: absolute;
- width: 64px;
- height: 2px;
- background: #A91B33;
- left: 50%;
- margin-left: -32px;
- bottom: 10px;
- }
- .channel_nav_right {
- flex: 1;
- padding: 10px 0px;
- }
- .channel_nav_a {
- float: left;
- height: 22px;
- line-height: 22px;
- position: relative;
- color: #fff;
- font-size: 16px;
- font-weight: bold;
- margin: 5px 13.5px;
- text-align: center;
- width: 96px;
- }
- .channel_nav_a::after {
- content: '';
- display: block;
- position: absolute;
- width: 1px;
- height: 14px;
- background: #BF3519;
- left: -14px;
- top: 5px;
- }
- }
- </style>
|