|
@@ -11,6 +11,7 @@
|
|
|
class="show-item b-rd-3xl relative"
|
|
|
:class="{ [`style-${item.styleType}`]: true }"
|
|
|
:style="{ backgroundImage: `url(${child.cover})` }"
|
|
|
+ @click="handleToDoc(child)"
|
|
|
>
|
|
|
<div
|
|
|
class="w-full h-full flex flex-col absolute top-0 left-0 -mx-auto justify-end overflow-hidden shadow-blueGray"
|
|
@@ -33,7 +34,11 @@
|
|
|
@swiper="onSwiper"
|
|
|
@slideChange="onSlideChange"
|
|
|
>
|
|
|
- <swiper-slide v-for="child of item.children" :key="child.id">
|
|
|
+ <swiper-slide
|
|
|
+ v-for="child of item.children"
|
|
|
+ :key="child.id"
|
|
|
+ @click="handleToDoc(child)"
|
|
|
+ >
|
|
|
<div
|
|
|
class="cover w-full h-[400px] overflow-hidden b-rd-xl"
|
|
|
:style="{ backgroundImage: `url(${child.cover})` }"
|
|
@@ -57,6 +62,7 @@
|
|
|
<n-grid x-gap="100" y-gap="100" :cols="2">
|
|
|
<n-gi v-for="child of item.children" :key="child.id">
|
|
|
<div
|
|
|
+ @click="handleToDoc(child)"
|
|
|
:class="{ [`style-${item.styleType}`]: true }"
|
|
|
class="show-item b-rd-3xl relative w-full h-full"
|
|
|
>
|
|
@@ -88,6 +94,7 @@
|
|
|
<n-grid x-gap="100" y-gap="100" :cols="3">
|
|
|
<n-gi v-for="child of item.children" :key="child.id">
|
|
|
<div
|
|
|
+ @click="handleToDoc(child)"
|
|
|
:class="{ [`style-${item.styleType}`]: true }"
|
|
|
class="show-item b-rd-3xl relative w-full h-full flex flex-col align-center items-center justify-center"
|
|
|
>
|
|
@@ -95,7 +102,9 @@
|
|
|
|
|
|
<div class="font-size-[20px] font-bold my-[16px]">{{ child.title }}</div>
|
|
|
|
|
|
- <div class="color-[#909090] w-[calc(100%-30px)] text-center">{{ child.description }}</div>
|
|
|
+ <div class="color-[#909090] w-[calc(100%-30px)] text-center">
|
|
|
+ {{ child.description }}
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</n-gi>
|
|
|
</n-grid>
|
|
@@ -107,7 +116,7 @@
|
|
|
|
|
|
<route lang="yaml">
|
|
|
meta:
|
|
|
-title: About
|
|
|
+ title: About
|
|
|
</route>
|
|
|
|
|
|
<script setup lang="ts">
|
|
@@ -118,6 +127,7 @@ import { Swiper, SwiperSlide } from 'swiper/vue'
|
|
|
|
|
|
// Import Swiper styles
|
|
|
import 'swiper/css'
|
|
|
+import router from '@/plugins/router.ts'
|
|
|
|
|
|
const list = ref<MenuItem[]>([])
|
|
|
|
|
@@ -133,6 +143,16 @@ const onSwiper = (swiper) => {
|
|
|
const onSlideChange = () => {
|
|
|
console.log('slide change')
|
|
|
}
|
|
|
+
|
|
|
+const handleToDoc = (child: never) => {
|
|
|
+ const { articleId, categoryId } = child
|
|
|
+ console.log(articleId, categoryId)
|
|
|
+ if (articleId) {
|
|
|
+ router.push({ path: '/showdoc', query: { id: articleId } })
|
|
|
+ } else {
|
|
|
+ router.push({ path: '/showdoc', query: { cid: categoryId } })
|
|
|
+ }
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|