This commit is contained in:
dute7liang
2023-12-19 22:23:45 +08:00
commit 97daeafbe7
117 changed files with 19926 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
import {onMounted, onUnmounted} from "vue";
export const useBackgroundHook = () => {
let bodyList = document.getElementsByTagName('body');
let body = bodyList[0]
let bodyBackground = body.style.background
const setBodyBackground = (option?: {mounted?: Function | undefined, unmounted?: Function | undefined}) => {
let {mounted, unmounted} = option || {}
onMounted(() => {
body.style.background = 'linear-gradient(167.96deg, #E6FAE1 0%, #F2E7B7 98.44%) no-repeat'
mounted && mounted()
})
onUnmounted(() => {
body.style.background = bodyBackground
unmounted && unmounted()
})
}
return { setBodyBackground }
}