Skip to content
Advertisement

Vue.js – Disable submit button unless original form data has changed

I have a simple form which I have created just for experiment purpose. I am trying to keep the button disable unless original form data is changed but still keep the button disabled if the data changes is reverted back to original data (undo).

JavaScript

I found a jQuery solution here but I am looking for vanilla/vue javascript solution.

JavaScript

Advertisement

Answer

Here’s how i would do it with the help of 1 module

npm i deep-diff

deep-diff is for comparing object values.

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement