// pages/components/project-select/index.js const app = getApp() Component({ /** * 组件的属性列表 */ properties: { init:{ type:Object }, width:{ type:String }, left:{ type:String } }, /**数据监听 */ observers: { init: function (val) { if(val){ this.setData({ item:val, }) } }, }, /** * 组件的初始数据 */ data: { show: false, index:0, item:'', columns:[], projectList:[], }, created(){ //this.getProjectNameList(); }, /** * 组件的方法列表 */ methods: { showPopup() { var data = this.data.projectList; var initData = this.data.init for(var i=0;i{ var that = this; that.setData({ projectList:res.data }) } }); }, } })