mirror of
https://github.com/jekip/naive-ui-admin.git
synced 2026-03-01 00:23:11 +08:00
fix Bug Features CHANGELOG.ms
This commit is contained in:
@@ -6,18 +6,18 @@ import { debounce } from 'lodash'
|
||||
*/
|
||||
|
||||
export function useDomWidth() {
|
||||
const domWidth = ref(window.innerWidth)
|
||||
const domWidth = ref(window.innerWidth)
|
||||
|
||||
function resize() {
|
||||
domWidth.value = document.body.clientWidth
|
||||
}
|
||||
function resize() {
|
||||
domWidth.value = document.body.clientWidth
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
window.addEventListener('resize', debounce(resize, 80))
|
||||
})
|
||||
onUnmounted(() => {
|
||||
window.removeEventListener('resize', resize)
|
||||
})
|
||||
onMounted(() => {
|
||||
window.addEventListener('resize', debounce(resize, 80))
|
||||
})
|
||||
onUnmounted(() => {
|
||||
window.removeEventListener('resize', resize)
|
||||
})
|
||||
|
||||
return domWidth
|
||||
return domWidth
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user