1.
<!-- 顶部分段器 -->
<view class="uni-padding-wrap uni-common-mt" v-show="typeIndex">
<uni-segmented-control :current="current" :values="items" style-type="button"
:activeColor="activeColor"></uni-segmented-control>
</view>
<!-- 搜索框 -->
<view class="input-view" v-show="!typeIndex">
<uni-icon type="search" size="22" color="#666666"></uni-icon>
<input confirm-type="search" class="input" type="text" placeholder="输入搜索关键词" />
</view>
<!-- 下边分段器 -->
<view class="uni-padding-wrap uni-common-mt">
<uni-segmented-control :current="current" :values="searchTypes" @clickItem="onClickItem" style-type="text"
:activeColor="activeColor"></uni-segmented-control>
</view>
2.
data() {
return {
items: [
'报修中',
'已处理',
],
searchTypes:[
'报修时间',
'维修状态'
],
typeIndex: false,
3. methods: {
onClickItem(index) {
this.typeIndex = !this.typeIndex;
}
}