zhaoxiaohai 3 лет назад
Родитель
Сommit
789706977c
1 измененных файлов с 8 добавлено и 0 удалено
  1. 8 0
      components/Yl_field/index.js

+ 8 - 0
components/Yl_field/index.js

@@ -84,6 +84,14 @@ Component({
             });
             this.confirm();
         },
+        /* 自定义选项 */
+        setOption(item) {
+            let i = this.data.form.findIndex(v => v.valueName == item.valueName);
+            this.setData({
+                [`form[${i}].value`]: item.value
+            });
+            this.confirm();
+        },
         /* 是否完成必填项 */
         confirm() {
             this.triggerEvent("onConfirm", this.data.form.some(v => v.required && v.value == ''))