You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
58 lines
1.6 KiB
58 lines
1.6 KiB
<template> |
|
<Footer v-if="getShowLayoutFooter" ref="footerRef" :class="prefixCls"> |
|
<div>Copyright ©2022 康来生物有限公司</div> |
|
</Footer> |
|
</template> |
|
|
|
<script lang="ts"> |
|
import { computed, defineComponent, unref, ref } from 'vue'; |
|
import { Layout } from 'ant-design-vue'; |
|
import { useI18n } from '/@/hooks/web/useI18n'; |
|
import { useRootSetting } from '/@/hooks/setting/useRootSetting'; |
|
import { useRouter } from 'vue-router'; |
|
import { useDesign } from '/@/hooks/web/useDesign'; |
|
import { useLayoutHeight } from '../content/useContentViewHeight'; |
|
|
|
export default defineComponent({ |
|
name: 'LayoutFooter', |
|
components: { Footer: Layout.Footer }, |
|
setup() { |
|
const { t } = useI18n(); |
|
const { getShowFooter } = useRootSetting(); |
|
const { currentRoute } = useRouter(); |
|
const { prefixCls } = useDesign('layout-footer'); |
|
|
|
const footerRef = ref<ComponentRef>(null); |
|
const { setFooterHeight } = useLayoutHeight(); |
|
|
|
const getShowLayoutFooter = computed(() => { |
|
if (unref(getShowFooter)) { |
|
const footerEl = unref(footerRef)?.$el; |
|
setFooterHeight(footerEl?.offsetHeight || 0); |
|
} else { |
|
setFooterHeight(0); |
|
} |
|
return unref(getShowFooter) && !unref(currentRoute).meta?.hiddenFooter; |
|
}); |
|
|
|
return { |
|
getShowLayoutFooter, |
|
prefixCls, |
|
t, |
|
footerRef, |
|
}; |
|
}, |
|
}); |
|
</script> |
|
<style lang="less" scoped> |
|
@prefix-cls: ~'@{namespace}-layout-footer'; |
|
|
|
@normal-color: rgba(0, 0, 0, 0.45); |
|
|
|
@hover-color: rgba(0, 0, 0, 0.85); |
|
|
|
.@{prefix-cls} { |
|
color: @normal-color; |
|
text-align: center; |
|
} |
|
</style>
|
|
|