更新0.1.1版本

This commit is contained in:
Ah jung
2021-07-07 10:26:14 +08:00
parent b74b6e61a4
commit d423f27e94
174 changed files with 15966 additions and 0 deletions

23
src/hooks/useDomWidth.ts Normal file
View File

@@ -0,0 +1,23 @@
import { ref, onMounted, onUnmounted } from 'vue'
import { debounce } from 'lodash'
/**
* description: 获取页面宽度
*/
export function useDomWidth() {
const domWidth = ref(window.innerWidth)
function resize() {
domWidth.value = document.body.clientWidth
}
onMounted(() => {
window.addEventListener('resize', debounce(resize, 80))
})
onUnmounted(() => {
window.removeEventListener('resize', resize)
})
return domWidth
}