From 49a9617edc88ed4d2b8a24d33efede818e27d49d Mon Sep 17 00:00:00 2001 From: "daniel.xiao" Date: Mon, 5 Aug 2019 10:16:16 +0800 Subject: [PATCH 1/3] feat(ncform): add item change event re #86 --- CONFIG.md | 15 ++++++++++++++ CONFIG_CN.md | 15 ++++++++++++++ .../components/vue-ncform/_others.html | 7 ++++++- .../src/components/vue-ncform/form-item.vue | 20 +++++++++++++++++-- .../src/components/vue-ncform/ncform.vue | 2 +- 5 files changed, 55 insertions(+), 4 deletions(-) diff --git a/CONFIG.md b/CONFIG.md index ccb3565..ac37867 100755 --- a/CONFIG.md +++ b/CONFIG.md @@ -281,3 +281,18 @@ Submit a form. // Demo code: ``` + +- change + +Form item value change event + +``` +// Demo code: + + +onChange({paths, itemValue, formValue}) { + // paths: the path of the item whose value changes +  // itemValue: the latest value of the item whose value has changed +  // formVallue: the latest value of the form +} +``` diff --git a/CONFIG_CN.md b/CONFIG_CN.md index 3c75f52..e8fa2ed 100644 --- a/CONFIG_CN.md +++ b/CONFIG_CN.md @@ -282,3 +282,18 @@ const allWidgets = this.$ncformAllWidgets(); // Demo code: ``` + +- change + +表单项值更改事件 + +``` +// Demo code: + + +onChange({paths, itemValue, formValue}) { + // paths: 发生值变化的项的路径 + // itemValue:发生值变化的项的最新值 + // formVallue: 表单的最新值 +} +``` diff --git a/packages/ncform/examples/components/vue-ncform/_others.html b/packages/ncform/examples/components/vue-ncform/_others.html index 52ff824..ce9e3e4 100644 --- a/packages/ncform/examples/components/vue-ncform/_others.html +++ b/packages/ncform/examples/components/vue-ncform/_others.html @@ -12,7 +12,7 @@