Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
hager
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
hookehuyr
2024-10-29 14:05:18 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
b4d908c93d0545d560cf128f3b16bc35188834db
b4d908c9
1 parent
98d86970
fix 搜索时报错问题处理
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
src/views/product/index.vue
src/views/product/index.vue
View file @
b4d908c
<!--
* @Date: 2024-09-27 16:53:09
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-10-2
8 17:58:59
* @LastEditTime: 2024-10-2
9 14:03:32
* @FilePath: /hager/src/views/product/index.vue
* @Description: 文件描述
-->
...
...
@@ -33,7 +33,7 @@
<div class="product-list">
<div class="product-item" v-for="(item, index) in product_list" :key="index">
<div class="product-item-img">
<img style="width: 100%; height: auto;" :src="item.
product_status === 'publish' ? item.cover : no_product_img
">
<img style="width: 100%; height: auto;" :src="item.
cover
">
</div>
<p @click="goToDetail(item)" class="product-item-title">{{ item.product_name }}</p>
</div>
...
...
@@ -44,7 +44,7 @@
<div v-else class="product-list">
<div class="product-item xs" v-for="(item, index) in product_list" :key="index">
<div @click="goToDetail(item)" class="product-item-img xs">
<img style="width: 35vw; height: auto;" :src="item.
product_status === 'publish' ? item.cover : no_product_img
">
<img style="width: 35vw; height: auto;" :src="item.
cover
">
</div>
<p @click="goToDetail(item)" class="product-item-title">{{ item.product_name }}</p>
</div>
...
...
@@ -143,13 +143,14 @@ export default {
const { code, data } = await getProductSearchAPI({ keyword: this.keyword });
if (code) {
this.product_list = data;
this.$router.push({
path: '/product/index',
//
this.$router.replace({
path: this.$route.path,
query: {
id: this.$route.query.id
,
...this.$route.query
,
keyword: this.keyword
}
})
})
;
}
} else { // 清空搜索值,还原
this.$router.push({
...
...
Please
register
or
login
to post a comment