mirror of
https://gitee.com/hhyykk/ipms-sjy-ui.git
synced 2025-02-01 19:24:58 +08:00
feat: ✨ add current year calculation to footer component
- 根据"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.
This commit is contained in:
parent
25484a941b
commit
700efd7ee2
@ -12,6 +12,9 @@ const prefixCls = getPrefixCls('footer')
|
||||
const appStore = useAppStore()
|
||||
|
||||
const title = computed(() => appStore.getTitle)
|
||||
|
||||
// 添加当前年份计算属性
|
||||
const currentYear = computed(() => new Date().getFullYear())
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@ -19,6 +22,6 @@ const title = computed(() => appStore.getTitle)
|
||||
:class="prefixCls"
|
||||
class="h-[var(--app-footer-height)] bg-[var(--app-content-bg-color)] text-center leading-[var(--app-footer-height)] text-[var(--el-text-color-placeholder)] dark:bg-[var(--el-bg-color)] overflow-hidden"
|
||||
>
|
||||
<span class="text-14px">Copyright ©2022-{{ title }}</span>
|
||||
<span class="text-14px">Copyright ©{{ currentYear }} {{ title }}</span>
|
||||
</div>
|
||||
</template>
|
||||
|
Loading…
Reference in New Issue
Block a user