vitepress-theme-base-teek
Version:
查看 [使用说明](https://vp.xiaoying.org.cn/pages/9d746f)
23 lines (17 loc) • 650 B
text/typescript
import { computed } from 'vue'
import { useUnrefData } from '../components/configProvider'
import { ArticleTip } from "../config/types";
export const useArticleTips = () => {
const { frontmatter, localeIndex, page, theme } = useUnrefData()
const { articleTopTip, articleBottomTip }: ArticleTip = { ...theme.articleTip , ...frontmatter.articleTip }
const topTipConfig = computed(() => {
return articleTopTip?.(frontmatter, localeIndex, page)
})
const bottomTipConfig = computed(() => {
return articleBottomTip?.(frontmatter, localeIndex, page)
})
return {
topTipConfig,
bottomTipConfig
}
}