zhaoxiaohai 3 rokov pred
rodič
commit
648c229b6d
1 zmenil súbory, kde vykonal 4 pridanie a 2 odobranie
  1. 4 2
      components/My_ChangeUser/index.js

+ 4 - 2
components/My_ChangeUser/index.js

@@ -25,9 +25,11 @@ Component({
         attached: function () {
             // 在组件实例进入页面节点树时执行
             let list = wx.getStorageSync('account_list');
-            const userList = setData.imageType(list, "headportrait");
+            const userList = setData.imageType(list, "headportrait"),
+                userIndex = (wx.getStorageSync('userData').index) ? wx.getStorageSync('userData').index : 0;
             this.setData({
-                userList
+                userList,
+                userIndex
             });
         }
     },