Basic Usage
Learn how you can use the Vue Craft CMS package.
Let's dive in and use that thing! This package offers flexible methods for integrating Craft CMS data into your Vue application.
Build Query URLs
This package does not include direct fetching from your Craft CMS backend to keep things flexible for you. Instead, you can use useCraftUrlBuilder()
to create custom query URLs and implement your own fetch function as needed.
You can build an url like that:
const queryUrl = useCraftUrlBuilder('entries')
.id(1)
.status('active')
.buildUrl('one')
//result = https://your-primary-site-url/v1/api/queryApi/customQuery?elementType=entries&id=1&status=active&one=1
You can find detailed instructions on how to build query urls here.
Connect Components
You can map Craft CMS section handles and matrix block handles to Vue components, enabling the module to automatically render Vue pages and Vue blocks based on your content structure. This method simplifies data rendering by letting the package handle the content logic.
You can find detailed instructions on how to connect your components here.