优化商城端可以重复搜索内容

This commit is contained in:
Yer
2023-04-21 17:36:02 +08:00
parent ebc79da0fc
commit b30be8efb2

View File

@@ -71,10 +71,15 @@ export default {
this.search(); this.search();
}, },
search () { // 全平台搜索商品 search () { // 全平台搜索商品
this.$router.push({ const url = this.$route.path;
path: '/goodsList', if(url == '/goodsList'){
query: { keyword: this.searchData } this.$emit('search', this.searchData)
}); }else{
this.$router.push({
path: '/goodsList',
query: { keyword: this.searchData }
});
}
}, },
searchStore () { // 店铺搜索商品 searchStore () { // 店铺搜索商品
this.$emit('search', this.searchData) this.$emit('search', this.searchData)