I created a webpage that pulls information from Contentful. Although the data is being retrieved correctly, buttons utilizing functions from methods are not working. Additionally, real-time updating of variables (such as using v-model
) is not functioning.
Upon checking the console, I found this error:
https://i.sstatic.net/K5azi.png
I suspect that this error might be causing the issues. Can anyone help identify what's causing this problem? I'm at a loss on how to fix it :(
The contentful.js file looks like this:
const contentful = require('contentful')
const client = contentful.createClient({
space: process.env.CONTENTFUL_ENV_SPACE_ID,
accessToken: process.env.CONTENTFUL_ENV_ACCESS_TOKEN
})
module.exports = client
This is the code responsible for fetching the data:
export default {
layout: "landing_page",
asyncData() {
return client
.getEntries({
content_type: "landingPage"
})
.then(entries => {
return { contentfulData: entries.items[0].fields };
});
},
computed: {
styles() {
return landingPageCss;
}
},
components: {
priceBox,
contact,
home,
aboutUs,
footerDiv
}
};