i try understand text but I dont know which file is meant I have to paste attached code
In your script
tag add the code in the snippet below.
Import getContent
, RenderContent
, isPreviewing
from the Vue SDK.
Using getContent()
, specify the page model, your Public API Key, and the URL path. Builder then responds with the page content.
<script>
// use this if you are on Vue 2
import { getContent, RenderContent, isPreviewing } from '@builder.io/sdk-vue/vue2';
// OR use this one if you are on Vue 3
import { getContent, RenderContent, isPreviewing } from '@builder.io/sdk-vue/vue3';
export default {
mounted() {
getContent({
model: 'page',
apiKey: YOUR_PUBLIC_API_KEY, // <-- Replace with your Public API Key
userAttributes: {
urlPath: window.location.pathname,
},
}).then(res => {
this.content = res;
this.canShowContent = this.content || isPreviewing();
});
},
}
</script>