mirror of https://github.com/vuejs/vitepress
parent
46758a507c
commit
dc2f98c443
@ -0,0 +1,15 @@
|
||||
import { useData } from './data'
|
||||
import type { DefaultTheme } from 'vitepress/theme'
|
||||
import { computed } from 'vue'
|
||||
|
||||
export function useScreenOnly(entry: keyof DefaultTheme.PrintOptions) {
|
||||
const { theme, frontmatter } = useData()
|
||||
|
||||
return computed(
|
||||
() =>
|
||||
frontmatter.value[entry] === false ||
|
||||
theme.value.print === false ||
|
||||
(typeof theme.value.print === 'object' &&
|
||||
theme.value.print[entry] === false)
|
||||
)
|
||||
}
|
Loading…
Reference in new issue