fix:修改搜索

merge-requests/9/head
张征 2 years ago
parent 17062ed082
commit c0e1a257fb

@ -75,7 +75,7 @@ export default {
-webkit-line-clamp: 2; -webkit-line-clamp: 2;
&-label { &-label {
display: inline-block; display: inline-block;
padding: 4px 8px; padding: 2px 8px;
background: rgba(255, 135, 91, 0.1); background: rgba(255, 135, 91, 0.1);
font-size: 12px; font-size: 12px;
font-family: Microsoft YaHei-Regular, Microsoft YaHei; font-family: Microsoft YaHei-Regular, Microsoft YaHei;

@ -244,7 +244,12 @@ export default {
}, },
onSearch() { onSearch() {
// //
this.$router.push("/goods/list"); this.$router.push({
path: "/goods/list",
query: {
keyword: this.searchContent,
},
});
}, },
}, },
}; };

@ -46,7 +46,7 @@
class="main__pagination flex flex-right" class="main__pagination flex flex-right"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
:current-page.sync="params.pageIndex" :current-page.sync="params.pageIndex"
:page-size="100" :page-size="20"
layout="prev, pager, next, jumper" layout="prev, pager, next, jumper"
:total="total" :total="total"
> >
@ -77,6 +77,7 @@ export default {
}; };
}, },
async created() { async created() {
this.params.name = this.$route.query.keyword;
this.getGoodsListData(); this.getGoodsListData();
}, },
methods: { methods: {
@ -125,6 +126,14 @@ export default {
vm.getGoodsListData(); vm.getGoodsListData();
}, },
}, },
watch: {
//
//categoryId
"$route.query.keyword": function () {
this.params.name = this.$route.query.keyword;
this.getGoodsListData();
},
},
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

Loading…
Cancel
Save