mirror of https://github.com/vuejs/vitepress
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.
22 lines
498 B
22 lines
498 B
import { useMediaQuery } from '@vueuse/core'
|
|
import { computed } from 'vue'
|
|
import { useSidebar } from './sidebar'
|
|
|
|
export function useAside() {
|
|
const { hasSidebar } = useSidebar()
|
|
const is960 = useMediaQuery('(min-width: 960px)')
|
|
const is1280 = useMediaQuery('(min-width: 1280px)')
|
|
|
|
const isAsideEnabled = computed(() => {
|
|
if (!is1280.value && !is960.value) {
|
|
return false
|
|
}
|
|
|
|
return hasSidebar.value ? is1280.value : is960.value
|
|
})
|
|
|
|
return {
|
|
isAsideEnabled
|
|
}
|
|
}
|