时间:2019-05-07 来源:小程序工厂
没用数据源,就是在data里初始化设置也不行
请提供出现问题的机型和微信版本,以及能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)
华为荣耀8X,微信6.7.3。
.wxml文件相关片断:
{{item.name}}
.js相关片断:
Page({
data: {
markers: [],
distance: '',
cost: '',
isShow: true,
tips: [{ id: "B000AA1BTJ", name: "青塔蔚园", district: "北京市丰台区", adcode: "110106", location: "116.26244,39.894146" }, { id: "B000AA1BTJ", name: "JJJ青塔蔚园", district: "北京市丰台区", adcode: "110106", location: "116.26244,39.894146" }],
city: '',
polyline: [],
LocationE:''
},
bindInput: function (e) {
var _this = this;
var keywords = e.detail.value;
var key = config.Config.key;
var myAmap = new amapFile.AMapWX({ key: key });
myAmap.getInputtips({
keywords: keywords,
location: '',
success: function (res) {
if (res && res.tips) {
var address = res.tips[0].district;
_this.setData({
isShow: true,
city: address.substring(address.indexOf('省') + 1, address.indexOf('市')),
tips: res.tips
});
console.log(_this.data.tips);
}
}
})
},
麻烦按这种格式提供代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)
检查tips 数据源。如果你在手机上预览的话,打开手机调试看看 会不会渲染,如果这样渲染的话,那就是没有配置https的问题
首先谢谢您的回答。
试了下,提前设置好数据,模拟机上能渲染,手机上预览还是不会渲染。