vue-meta

Gridsome build failing with TypeError

≡放荡痞女 提交于 2020-08-10 23:43:46
问题 I'm encountering some trouble running Gridsome build on a starter project template. The site runs on localhost with no problem. I tried npm install gridsome@latest to update or install any missing packages. Gridsome build gives me the following error: Could not generate HTML for "/work/": TypeError: Cannot read property 'console' of null at Object. (C:\Users\Micah\Desktop\my-gridsome-site\node_modules\vue-meta\dist\vue-meta.common.js:103:23) at Module._compile (internal/modules/cjs/loader.js

How to use a Vue variable in metaInfo?

别等时光非礼了梦想. 提交于 2020-03-04 16:39:06
问题 What is the correct syntax for this line Vue inside the script: export default { metaInfo: { title: "{product.name} wallpaper", The line came to the form: title: "Space wallpaper", product.name I get it in api: mounted() { let vm = this vm.getProducts(); }, methods: { getProducts() { let vm = this axios.get('/api/products') .then(function(response) { vm.products = response.data.data }) 回答1: Template literals use backticks and a dollar sign before the braces, e.g.: title: `${product.name}

Sending the data-api-key value for Snipcart w/vue meta in gridsome

99封情书 提交于 2020-03-03 09:12:14
问题 I am doing an eCommerce site w/gridsome & snipcart. The problem is when I test snipcart's checkout it fails. The snipcart documentation says to add a line <div id="snipcart" data-api-key="myapikey" hidden></div> which I added to default.vue file in my layouts folder. But when I inspect element after build I see in DOM <div id="snipcart" class="snipcart"></div> The data-api-key attribute is not rendered. Utilizing vue-meta to inject api-key-data into markup in main.js per snipcart's [example]

Sending the data-api-key value for Snipcart w/vue meta in gridsome

怎甘沉沦 提交于 2020-03-03 09:09:12
问题 I am doing an eCommerce site w/gridsome & snipcart. The problem is when I test snipcart's checkout it fails. The snipcart documentation says to add a line <div id="snipcart" data-api-key="myapikey" hidden></div> which I added to default.vue file in my layouts folder. But when I inspect element after build I see in DOM <div id="snipcart" class="snipcart"></div> The data-api-key attribute is not rendered. Utilizing vue-meta to inject api-key-data into markup in main.js per snipcart's [example]