12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- // components/My_ChangeUser/index.js
- Component({
- /**
- * 组件的属性列表
- */
- properties: {
- /* 选择用户列表下标 */
- userIndex: {
- type: Number,
- value:0
- }
- },
- /**
- * 组件的初始数据
- */
- data: {
- userList: [], //用户列表
- },
- /* 组件的生命周期 */
- lifetimes: {
- attached: function () {
- // 在组件实例进入页面节点树时执行
- this.setData({
- userList: getApp().globalData.account_list
- });
- }
- },
- /**
- * 组件的方法列表
- */
- methods: {
- /* 用户账号选择 */
- userChange(e) {
- // console.log(e)
- const {
- index
- } = e.currentTarget.dataset;
- this.triggerEvent('userChange',{userIndex:index})
- }
- }
- })
|