Parcourir la source

修复重置日期bug

xiaohaizhao il y a 1 an
Parent
commit
a41d2dbcfd
1 fichiers modifiés avec 3 ajouts et 2 suppressions
  1. 3 2
      packageA/work/add.js

+ 3 - 2
packageA/work/add.js

@@ -471,8 +471,9 @@ Page({
     },
     reset() {
         let form = this.data.form;
-        form[4].value = "";
-        form.splice(5, 2);
+        let index = form.findIndex(v => v.label == '开始日期');
+        form[index].value = "";
+        form.splice(index + 1, 2);
         this.setData({
             isReset: true,
             disabled: true,