浏览代码

二期组件

zhaoxiaohai 2 年之前
父节点
当前提交
aae6329889
共有 1 个文件被更改,包括 21 次插入19 次删除
  1. 21 19
      components/Yl_ReportForms/index.js

+ 21 - 19
components/Yl_ReportForms/index.js

@@ -1,23 +1,25 @@
 Component({
-  properties: {
-    list: Array,
-    showAll: {//是否显示全部(包含值为空项)
-      type: Boolean,
-      value: true
-    }
-  },
-  methods: {
-    /* 单击项目 */
-    clickItem(e) {
-      const {
-        item
-      } = e.currentTarget.dataset;
+    properties: {
+        list: Array,
+        showAll: { //是否显示全部(包含值为空项)
+            type: Boolean,
+            value: true
+        },
+        clickItem: Function
     },
-    /* 单击补充区域 */
-    clickRep(e) {
-      const {
-        item
-      } = e.currentTarget.dataset;
+    methods: {
+        /* 单击项目 */
+        clickItem(e) {
+            const {
+                item
+            } = e.currentTarget.dataset;
+            this.triggerEvent("clickItem", item)
+        },
+        /* 单击补充区域 */
+        clickRep(e) {
+            const {
+                item
+            } = e.currentTarget.dataset;
+        }
     }
-  }
 })