diff --git a/app/components/Carousel.vue b/app/components/Carousel.vue
index 631c4fe..7a34254 100644
--- a/app/components/Carousel.vue
+++ b/app/components/Carousel.vue
@@ -3,6 +3,7 @@
-
+
+
+
+
@@ -62,23 +87,41 @@ const props = withDefaults(
}
)
+type AntdCarouselExpose = {
+ next: () => void
+ prev: () => void
+ goTo: (slide: number, dontAnimate?: boolean) => void
+}
+
+const carouselRef = ref(null)
+
const heightCss = computed(() => (typeof props.height === 'number' ? `${props.height}px` : props.height))
const normalizedItems = computed(() => (props.items || []).filter((it) => it && typeof it.src === 'string' && it.src))
const autoplayEnabled = computed(() => normalizedItems.value.length > 1)
const dotsEnabled = computed(() => normalizedItems.value.length > 1)
+const showNav = computed(() => normalizedItems.value.length > 1)
const fallbackSrc = computed(() => normalizedItems.value[0]?.src || '')
function isExternal(href: string) {
return /^https?:\/\//i.test(href)
}
+
+function next() {
+ carouselRef.value?.next()
+}
+
+function prev() {
+ carouselRef.value?.prev()
+}
diff --git a/app/components/SiteHeader.vue b/app/components/SiteHeader.vue
index 411c0df..b9ac94d 100644
--- a/app/components/SiteHeader.vue
+++ b/app/components/SiteHeader.vue
@@ -30,10 +30,10 @@
-
+
-
-
+
+
{{ siteName }}
@@ -119,6 +119,7 @@ import { COMPANY } from '@/config/company'
const route = useRoute()
const open = ref(false)
+const isAffixed = ref(false)
type HeaderNavItem = {
key: string
@@ -281,6 +282,10 @@ const todayText = computed(() => {
const pad = (n: number) => String(n).padStart(2, '0')
return `${d.getFullYear()}年${pad(d.getMonth() + 1)}月${pad(d.getDate())}日 星期${week}`
})
+
+function onAffixChange(affixed: boolean) {
+ isAffixed.value = affixed
+}