快乐的梦鱼 1 月之前
父节点
当前提交
3292947204
共有 7 个文件被更改,包括 18 次插入14 次删除
  1. 3 3
      nuxt.config.ts
  2. 2 1
      src/assets/scss/main.scss
  3. 5 0
      src/components/NavBar.vue
  4. 3 3
      src/pages/channel/[id].vue
  5. 0 1
      src/pages/channel/laws.vue
  6. 2 3
      src/pages/index.vue
  7. 3 3
      src/pages/page/[id].vue

+ 3 - 3
nuxt.config.ts

@@ -48,13 +48,13 @@ export default defineNuxtConfig({
     },
   },
   routeRules: {
-    //'/**': { swr: false, isr: false, headers: { 'cache-control': 'no-store, max-age=0' } },
+    '/**': { swr: false, isr: false, headers: { 'cache-control': 'no-store, max-age=0' } },
     
-    /**/
+    /*
     '/': { swr: 1800 },
     '/about/': { swr: 1800 },
     '/channel/**': { swr: 1800 },
     '/page/submit': {swr: 1800 },
-    '/search/**': { swr: false },
+    '/search/**': { swr: false },*/
   }
 })

+ 2 - 1
src/assets/scss/main.scss

@@ -163,8 +163,9 @@ nav.main-nav {
   a {
     display: block;
     color: var(--color-text);
-    padding: 12px 20px;
+    padding: 12px 10px;
     font-weight: 500;
+    white-space: nowrap;
     transition: background-color 0.3s;
 
     &:hover, &:active {

+ 5 - 0
src/components/NavBar.vue

@@ -40,6 +40,11 @@ const navItems = await useSSrSimpleDataLoader('navItems', async () => {
     lawsPage.type = 'link';
     lawsPage.outlink = '/channel/laws/?id=' + lawsPage.id;
   }
+  const contactPage = data.find(item => item.name === '联系我们');
+  if (contactPage) {
+    contactPage.type = 'link';
+    contactPage.outlink = '/about';
+  }
 
   return data.map(item => {
     return {

+ 3 - 3
src/pages/channel/[id].vue

@@ -8,13 +8,13 @@
       <Meta name="keywords" content="" />
     </Head>
     <!-- 轮播 -->
-    <Carousel v-bind="carouselConfig" class="main-header-box small carousel-light">
+    <Carousel v-bind="carouselConfig" class="main-header-image carousel-light">
       <Slide 
         v-for="(item, key) in carouselData.content.value"
         :key="key"
-        class="main-header-box small"
+        class="main-header-image"
       >
-        <img :src="item.image" />
+        <img class="main-header-image" :src="item.image" />
       </Slide>
       <template #addons>
         <Navigation />

+ 0 - 1
src/pages/channel/laws.vue

@@ -92,7 +92,6 @@
 <script setup lang="ts">
 import { computed, ref } from 'vue';
 import { useRouter, useRoute } from 'vue-router';
-import { Carousel, Slide, Pagination, Navigation } from 'vue3-carousel'
 import { useSSrSimpleDataLoader } from '@/composeable/SimpleDataLoader';
 import { DateUtils } from '@imengyu/imengyu-utils';
 import type { IChannel } from '~~/server/api/channel/[id]';

+ 2 - 3
src/pages/index.vue

@@ -8,13 +8,12 @@
       <Meta name="keywords" content="" />
     </Head>
     <!-- 轮播 -->
-    <Carousel v-bind="carouselConfig" class="main-header-box small carousel-light">
+    <Carousel v-bind="carouselConfig">
       <Slide 
         v-for="(item, key) in carouselData.content.value"
         :key="key"
-        class="main-header-box small"
       >
-        <img :src="item.image" />
+        <img class="main-header-image" :src="item.image" />
       </Slide>
       <template #addons>
         <Navigation />

+ 3 - 3
src/pages/page/[id].vue

@@ -8,13 +8,13 @@
       <Meta name="keywords" content="" />
     </Head>
     <!-- 轮播 -->
-    <Carousel v-bind="carouselConfig" class="main-header-box small carousel-light">
+    <Carousel v-bind="carouselConfig" class="main-header-image carousel-light">
       <Slide 
         v-for="(item, key) in carouselData.content.value"
         :key="key"
-        class="main-header-box small"
+        class="main-header-image"
       >
-        <img v-if="item.image" :src="item.image" />
+        <img class="main-header-image" v-if="item.image" :src="item.image" />
       </Slide>
       <template #addons>
         <Navigation />