diff --git a/src/components/Form/Form.vue b/src/components/Form/Form.vue index 386c2db7..102a6ecc 100644 --- a/src/components/Form/Form.vue +++ b/src/components/Form/Form.vue @@ -5,6 +5,7 @@ :doctype="doctype" :name="name" :title="formTitle" + :isDirty="isDirty" @save="save" />
@@ -37,6 +38,7 @@ export default { docLoaded: false, notFound: false, invalid: false, + isDirty: false, invalidFields: [] } }, @@ -58,6 +60,9 @@ export default { if (!this.name) return; try { this.doc = await frappe.getDoc(this.doctype, this.name); + this.doc.on('change', () => { + this.isDirty = this.doc._dirty; + }); this.docLoaded = true; } catch(e) { this.notFound = true; diff --git a/src/components/Form/FormActions.vue b/src/components/Form/FormActions.vue index 90e70ee5..46b963fc 100644 --- a/src/components/Form/FormActions.vue +++ b/src/components/Form/FormActions.vue @@ -1,11 +1,11 @@ diff --git a/src/components/Form/FormLayout.vue b/src/components/Form/FormLayout.vue index 7ee279e2..b7e57414 100644 --- a/src/components/Form/FormLayout.vue +++ b/src/components/Form/FormLayout.vue @@ -1,29 +1,29 @@