wxml:
<mp-searchbar
id="search"
bindselectresult="selectResult"
search="{{search}}"
bindcancel="searchCancel"
placeholder="{{searchbarplaceholder}}">
</mp-searchbar>
js:
data: {
searchbarplaceholder: "在水文站中搜索",
},
无效
var value = "在周边" + stations.length + "个水文站中搜索";
_this.setData({
searchbarplaceholder: value
})
也无效
_this.selectComponent("#search").data.placeholder = value;
也无效。
cosole中查看_this.selectComponent("#search").data.placeholder值已经被修改了,但是界面上还是默认的“搜索”