官方示例:https://ext.dcloud.net.cn/plugin?id=866
例1 -基础用法
<template>
<view>
<view>
<uni-search-bar @confirm="search" :focus="true" v-model="searchValue" @blur="blur" @input="input" @cancel="cancel" @change="change" @clear="clear">
</uni-search-bar>
当前输入为:{
{ searchValue }}
</view>
</view>
</template>
<script>
export default {
data() {
return {
searchValue: '123123'
}
},
methods: {
search(res) {
uni.showToast({
title: '搜索:' + res.value,
icon: 'none'
})
},
input(res) {
console.log