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-23 17:07:47 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
68da18b90743fc2e16a51a428bbee23fc2cc2bff
68da18b9
1 parent
8d97d7b8
fix 多行产品标题函数适配优化
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
src/components/common/hagerHeader.vue
src/components/common/hagerHeader.vue
View file @
68da18b
<!--
* @Date: 2024-09-26 13:42:11
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-10-23 1
5:26:14
* @LastEditTime: 2024-10-23 1
7:05:50
* @FilePath: /hager/src/components/common/hagerHeader.vue
* @Description: 文件描述
-->
...
...
@@ -72,7 +72,7 @@
<div class="product-left-wrapper">
<div :class="['product-left-item', p_index === index ? 'active' : '']" v-for="(item, index) in product_menu" :key="index" @click="onClick(item, index)">
<div class="icon-text">
<el-image style="width: auto; height: 1.65rem" :src="item.
cover
" fit="fit"></el-image>
<el-image style="width: auto; height: 1.65rem" :src="item.
icon
" fit="fit"></el-image>
{{ item.category_name }}
</div>
...
...
@@ -94,7 +94,7 @@
<div v-for="(item, index) in product_info" :key="index" class="product-right-center-item">
<div @click="goToC(item)" class="header-text">{{ item.category_name }} </div>
<div>
<div class="item-text" @click="goToP(
item
)" v-for="(p, idx) in item.list" :key="idx">{{ p.product_name }}</div>
<div class="item-text" @click="goToP(
p
)" v-for="(p, idx) in item.list" :key="idx">{{ p.product_name }}</div>
</div>
</div>
</div>
...
...
@@ -222,23 +222,27 @@ export default {
for (let i = 0; i < product.list?.length; i += maxLength) {
listChunks.push(product.list.slice(i, i + maxLength));
}
console.warn(listChunks);
// 第一个块保留原有的 name,后续块 name 设为空
listChunks.forEach((chunk, index) => {
if (index === 0) {
result.push({
name: product.product_name,
id: product.id,
category_name: product.category_name,
list: chunk
});
} else {
result.push({
name: '',
id: '',
category_name: '',
list: chunk
});
}
});
}
});
console.warn('res', result);
return result;
},
...
...
@@ -303,6 +307,7 @@ export default {
id: item.id,
}
});
this.closeMenu();
},
goToP (item) { // 跳转产品详情
...
...
Please
register
or
login
to post a comment