顺带一提:微信小程序是不能直接连接数据库的,所以想要获取数据库的真实地址是要通过访问接口来实现的。

1.微信小程序设置普通参数:

data: {      abc: "",      qwe: "",  },  onLoad: function (options) {    var self = this        self.setData({          abc: options.a          qwe: options.b        })      }   

2.设置对象参数

data: {info:{      abc: ""}  },  onLoad: function (options) {    var self = this    var abcd = 'info.abc'        self.setData({          [abcd]: options.a        })      }   

也可以直接写:

data: {info:{      abc: ""}  },  onLoad: function (options) {    var self = this        self.setData({          'info.abc': options.a        })      }   

 

TAG标签: 微信小程序配置

http://www.xiaochengxub.com/read-100213.html