fix: 修复同页面内切换搜索框后搜索选项不立即变化的问题

This commit is contained in:
陈劲松
2020-03-03 14:12:21 +08:00
parent 0e0c340025
commit 29f8797a93
2 changed files with 15 additions and 4 deletions

View File

@@ -182,6 +182,15 @@
} }
}, },
watch: { watch: {
searchMsg: {
deep: true,
immediate: true,
handler(n, o) {
this.$nextTick(() => {
this.clear_input();
})
}
},
select_list: { select_list: {
//监听下拉列表 //监听下拉列表
handler(newData, oldData) { handler(newData, oldData) {
@@ -941,8 +950,10 @@
}, },
//阻止冒泡事件 //阻止冒泡事件
stop_click(e) { stop_click(e) {
if (e) {
e.cancelBubble = true; e.cancelBubble = true;
e.stopPropagation(); e.stopPropagation();
}
}, },
//点击遮罩层 //点击遮罩层
zhezhao_click() { zhezhao_click() {

View File

@@ -57,7 +57,7 @@
<i class="nz-icon-create-square nz-icon"></i> <i class="nz-icon-create-square nz-icon"></i>
</button> </button>
<div class="top-tool-search float-right"> <div class="top-tool-search float-right">
<search-input :searchMsg="searchMsg" @search="search" v-if="tabShow==1"></search-input> <search-input ref="searchInput" :searchMsg="searchMsg" @search="search" v-if="tabShow==1"></search-input>
</div> </div>
</div> </div>
</div> </div>
@@ -151,7 +151,7 @@
<i class="nz-icon-create-square nz-icon"></i> <i class="nz-icon-create-square nz-icon"></i>
</button> </button>
<div class="top-tool-search float-right"> <div class="top-tool-search float-right">
<search-input :searchMsg="cabSearchMsg" @search="cabSearch" v-if="tabShow==2"></search-input> <search-input ref="cabSearchInput" :searchMsg="cabSearchMsg" @search="cabSearch" v-if="tabShow==2"></search-input>
</div> </div>
</div> </div>
</div> </div>