fix: 修复控制台报错

- 修复错误字段长度判断引发的异常
- 修复错误的 placeholder 内容文本
This commit is contained in:
Huangzhe
2025-05-19 19:38:17 +08:00
parent 54d47ee45f
commit 0588282b19
2 changed files with 2 additions and 2 deletions

View File

@@ -22,7 +22,7 @@ const chartHeight = computed(() => {
const optionLength = analysis.value?.option?.length;
// 做一些额外的检测, 如果 option 下面的title 字段超过 8 个,就把 addHeight 增加
analysis.value?.option?.forEach((item: any) => {
if (item.title.length > 8) {
if (item.title?.length > 8) {
addHeight += 5;
}
});

View File

@@ -52,7 +52,7 @@ function handleSearchClick() {
<div class="container-body">
<!-- 搜索栏 -->
<section class="search">
<search-bar :placeholder="请输入关键字" :value="keyword" @click="handleSearchClick" />
<search-bar placeholder="请输入关键字" :value="keyword" @click="handleSearchClick" />
</section>
<!-- 首页轮播图 -->
<section class="slider">