Skip to content
Advertisement

Tag: vue.js

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

how to get data use fetch API correctly in vue js?

I’m trying to fetch data from the backend using the GET method, but I always fail to get the data. I get the following error: CORS header ‘Access-Control-Allow-Origin’ missing. I don’t know how it happens because I tried to use POST method to my backend it worked. Here’s a capture of my browser tools When I use fetch to get

What is the best way to reference an item in Vue?

My goal is to get the item that was clicked and based on that do some action. I have a few items that share the same event (click) but have different functionality. I want to unite them under one function and based on some attribute refer to the clicked item. So far I’ve been doing this using classes, for instance

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