Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Provide a hook to get the current frontmatter #40

Closed
hairyf opened this issue Jul 10, 2022 · 2 comments
Closed

Feat: Provide a hook to get the current frontmatter #40

hairyf opened this issue Jul 10, 2022 · 2 comments

Comments

@hairyf
Copy link
Contributor

hairyf commented Jul 10, 2022

Get more fine-grained control over a single page

<!-- layouts/xxx.vue -->
<script setup>
import { useFrontmatter } from 'valaxy'
const frontmatter = useFrontmatter()
frontmatter.value.updated // number
</script>

or like this

<!-- layouts/xxx.vue -->
<script setup>
import { useRoute } from 'valaxy'
const route = useRoute()
route.meta.frontmatter.updated // number
</script>
@YunYouJun
Copy link
Owner

useFrontmatter is supported.

@hairyf
Copy link
Contributor Author

hairyf commented Jul 10, 2022

ok this is my question

@hairyf hairyf closed this as completed Jul 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants