下载后将文件放入小程序内
page/index/index.json中:
{
"usingComponents": {
"mp-searchbar": "../component/searchbar/searchbar"
}
}
page/index/index.wxml中:
<view class="page__bd">
<mp-searchbar bindselectresult="selectResult" search="{
{search}}"></mp-searchbar>
</view>
page/index./index.js中:
Page({
data: {
inputShowed: false,
inputVal: ""
},
onLoad() {
this.setData({
search: this.search.bind(this)