Przeglądaj źródła

修复重置日期bug

xiaohaizhao 1 rok temu
rodzic
commit
a41d2dbcfd
1 zmienionych plików z 3 dodań i 2 usunięć
  1. 3 2
      packageA/work/add.js

+ 3 - 2
packageA/work/add.js

@@ -471,8 +471,9 @@ Page({
     },
     },
     reset() {
     reset() {
         let form = this.data.form;
         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({
         this.setData({
             isReset: true,
             isReset: true,
             disabled: true,
             disabled: true,