页面获取组件里面的值
组件要写 id 方便获取对象
//wxml
<searchBar id="searchBar"></searchBar>
主要方法: this.selectComponent("#组件的ID");
//js
chooseOk:function(e){
// 获取组件对象
var searchBar=this.selectComponent("#searchBar");
console.log(searchBar)
//取值
var name=this.selectComponent("#searchBar").data.name;
console.log(name)
//wx.navigateBack({
//delta: 1
//})
},