pages.json 文件
{
"path": "pages/index/search",
"style": {
"app-plus": {
"scrollIndicator": "none",
"bounce": "none",
"titleNView": {
"searchInput": {
"align": "left",
"backgroundColor": "#F7F7F7",
"borderRadius": "4px",
"placeholder": "搜索一下",
"placeholderColor": "#CCCCCC",
"disabled": false
},
"buttons": [{
"color": "#989898",
"colorPressed": "#Fd6801",
"float": "right",
"fontSize": "14px",
"text": "搜索"
}]
}
}
}
},
vue文件
// 监听导航输入
onNavigationBarSearchInputChanged(e) {
this.keywords = e.text
if (this.keywords == '') {
this.search_list = []
}
},
onNavigationBarSearchInputConfirmed() {
uni.hideKeyboard();
this.search_history_key(this.keywords)
this.search_lists(this.keywords)
},
//监听搜素点击提交
onNavigationBarButtonTap(e) {
//收起键盘
uni.hideKeyboard();
if (this.keywords == '') {
this.search_list = ''
uni.showToast({
title: '请输入搜索的内容',
icon: "none",
position: "bottom",
duration: 1500
});
return false;
}
if (e.index == 0) {
this.search_history_key(this.keywords)
this.search_lists(this.keywords)
}
},
2 个回复
i***@langlang.net.cn (作者) - uniapp
安卓APP正常(看附件1)
鸿蒙不显示了(看附件2)
DCloud_UNI_yuhe
鸿蒙上,不支持 plus 的相关内容