From 700efd7ee230af3110c8448a6c4895d725afe7aa Mon Sep 17 00:00:00 2001 From: AhJindeg Date: Fri, 3 Jan 2025 15:20:04 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E2=9C=A8=20add=20current=20year=20calc?= =?UTF-8?q?ulation=20to=20footer=20component?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 根据"DRY"(Don't Repeat Yourself)原则,使用动态年份代替硬编码,确保年份始终保持最新 - Introduced a new computed property `currentYear` in `Footer.vue` to dynamically display the current year in the copyright notice. - Updated the copyright span to use `currentYear` instead of a hardcoded year, enhancing maintainability and accuracy. --- src/layout/components/Footer/src/Footer.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/layout/components/Footer/src/Footer.vue b/src/layout/components/Footer/src/Footer.vue index 62302fca..98ce7e56 100644 --- a/src/layout/components/Footer/src/Footer.vue +++ b/src/layout/components/Footer/src/Footer.vue @@ -12,6 +12,9 @@ const prefixCls = getPrefixCls('footer') const appStore = useAppStore() const title = computed(() => appStore.getTitle) + +// 添加当前年份计算属性 +const currentYear = computed(() => new Date().getFullYear())