Closed Snakzi closed 3 years ago
Can you create a reproduction demo ? (You can use https://codesandbox.io)
I'm not very familiar with Sandboxes. If you already have a template for a sandbox with Nuxt + vForm, I can probably recreate it.
But I created a gist of my edit page, this is the only page affected. https://gist.github.com/Snakzi/de8a64459d95f822e9a2c43a032aec2e
Also, I'm using your laravel-nuxt package (which is very good for beginners like me)
API-response is this: https://i.imgur.com/4WQgi7C.png
Hello @cretueusebiu
I managed to set a sandbox up somehow. It spits out an error with vue-loader but the issue is almost the same. If you go from a nav-link (from About -> Go to issue) you'll see that the input field stays. But if you refresh the page on the issue page, it gets removed and NORMALLY spits out the error "_vm.form.errors.has is not a function"
It looks like that the form is not getting filled correctly. Because when I try to send it again, I also get an error "undefined". It's a really weird behaviour but the only option I know on how to create an edit page.
You are returning the form instance from asyncData, but that won't work with SSR. Here's how you do it: https://codesandbox.io/s/stoic-minsky-j5pgl?file=/pages/index.vue
You are a life saver! Thank you very very much. Last question:
How would I set the post query so that the backend doesnt show it needs a file when the user does not change the image. Can you exclude specific data (for example serverimg) from a form.patch method?
I don't think I understand what you're trying to do...
Okay, so I have a edit page /edit/:id
each post has 2 images. (cover image and logo image) those are required fields when creating a post. but if you want to edit something, but not update the images, I need to know if theres a way to tell vform that the image vars shouldnt be posted because it would send the image url
back to my backend but my backend expects a file.
You would just create 2 forms one for create and one for update with only the fields you need for that action. Or do some checks on your back-end.
Hi,
I'm trying to set up a edit page, however while receiving the data (to put in the input fields etc), I get this error. It looks like that its an issue with the vForm.
or just
always prints out
_vm.form.errors.has is not a function
it works when I wrap my template to a client-only page, but I need to use SSR in NuxtJS.