Browse Source

添加默认选项

xiaohaizhao 2 năm trước cách đây
mục cha
commit
c91b6d15e5
1 tập tin đã thay đổi với 6 bổ sung1 xóa
  1. 6 1
      packageA/salesHourglass/index.js

+ 6 - 1
packageA/salesHourglass/index.js

@@ -56,6 +56,8 @@ Page({
             valueKey: "dateType", //返回Key
             selectKey: "id",
             value: "id", //选中值
+            index: 0,
+            default: 0,
             list: [{
                 name: "近一年",
                 id: 1
@@ -110,7 +112,10 @@ Page({
 
             data.list.map((v, i) => {
                 v.index = i;
-                if (v.type == '人员' && v.id == wx.getStorageSync('userMsg').userid) data.index = i;
+                if (v.type == '人员' && v.id == wx.getStorageSync('userMsg').userid) {
+                    data.index = i
+                    data.default = i
+                };
                 return v
             })