Skip to content
Advertisement

Tag: nuxt.js

localstorage.getItem() not working in NUXT JS

I am trying to develop a shopping cart with nuxt js. I am successfully storing the cart data in local storage but I am unable to retrieve the data. N.B: i don’t wanna use vuex-persistedstate. Answer I see lots of small problems with this. First of all, it looks like you’ve put addToCart and saveInLocalStorage judging by the fact you

How to make a plugin work on refresh? (Nuxt)

I am trying to use the vue GAPI plugin in a project. It works fine when navigating between pages, but on refresh I get the error: vue-gapi.common.js?15fd:241 Uncaught (in promise) Error: gapi not initialized at GoogleAuthService.isSignedIn (vue-gapi.common.js?15fd:241) I think this is due to the way I am initialising the component in my project – namely through the /plugins folder. I

Go to next input field at maxLength?

I have a form in Vue that has some combined inputs for styling reasons for a phone number input. My problem is that the user has to hit tab in order to go to the next input field of the phone number. Is there a way to check for the max length of the current and input and when that

nuxtjs – setting background-url to image from assets doesn’t work

after lots of research I haven’t found a solution which explains why this is happening. When trying to set the background-image in my div dynamically it doesn’t work and I am getting an 404 error. http://localhost:3000/~assets/images/postPreview.jpg 404 (Not Found) I am passing it like this (thumbnail): ~assets/images/postPreview.jpg and get the above error. If i pass it like this then it

Advertisement