Compare commits

..

2 Commits

Author SHA1 Message Date
b2b631ed46 fix: 暂时将html渲染回滚到v-html
All checks were successful
deploy to server / build-and-deploy (push) Successful in 2m59s
- 暂时弃用html-renderer,改为v-html
- html-typography增添表格样式
2025-11-14 13:30:25 +08:00
ec9a097ef5 fix: 暂时弃用html-renderer将html渲染回滚到v-html
All checks were successful
deploy to server / build-and-deploy (push) Successful in 2m56s
- 增添table样式
2025-11-14 13:29:00 +08:00
6 changed files with 79 additions and 32 deletions

View File

@ -47,7 +47,49 @@
margin: 20px 0;
}
/* 表格基础样式 */
.html-typography table {
width: 100%;
border-collapse: collapse;
border: 1px solid var(--el-border-color);
margin: 1em 0;
table-layout: auto;
font-size: 14px;
}
/* 单元格通用样式 */
.html-typography th,
.html-typography td {
border: 1px solid var(--el-border-color);
padding: 8px 12px;
text-align: left;
vertical-align: middle;
word-break: break-word;
}
/* 表头样式 */
.html-typography th {
background-color: var(--el-fill-color-light);
color: var(--el-text-color-primary);
font-weight: 600;
}
/* 行 hover 效果 */
.html-typography tbody tr:hover {
background-color: var(--el-fill-color-light-hover);
}
/* 交替行背景 */
.html-typography tbody tr:nth-child(odd) {
background-color: var(--el-fill-color-lighter);
}
/* 表格标题(如有 caption */
.html-typography table caption {
caption-side: top;
text-align: left;
padding: 8px 0;
font-size: 14px;
font-weight: 600;
color: var(--el-text-color-primary);
}

View File

@ -3,13 +3,14 @@
<el-tabs v-model="activeName" class="product-tabs" stretch>
<el-tab-pane :label="$t('product-tab.details')" name="details">
<!-- eslint-disable-next-line vue/no-v-html -->
<div v-if="!hydrated" v-html="product.description || ''" />
<div v-else>
<html-renderer
class="html-typography"
:html="product.description || ''"
/>
</div>
<div class="html-typography" v-html="product?.description || ''" />
<!-- <div v-if="!hydrated" v-html="product.description || ''" /> -->
<!-- <div v-else> -->
<!-- <html-renderer -->
<!-- class="html-typography" -->
<!-- :html="product.description || ''" -->
<!-- /> -->
<!-- </div> -->
</el-tab-pane>
<el-tab-pane :label="$t('product-tab.specs')" name="specs">
<spec-table :data="product.specs" />

View File

@ -6,10 +6,11 @@
</header>
<section class="solution-content">
<!-- eslint-disable-next-line vue/no-v-html -->
<div v-if="!hydrated" v-html="solution?.content || ''" />
<div v-else>
<html-renderer class="html-typography" :html="solution.content || ''" />
</div>
<div class="html-typography" v-html="solution?.content || ''" />
<!-- <div v-if="!hydrated" v-html="solution?.content || ''" /> -->
<!-- <div v-else> -->
<!-- <html-renderer class="html-typography" :html="solution.content || ''" /> -->
<!-- </div> -->
</section>
</article>
</template>

View File

@ -9,13 +9,14 @@
:name="question.id"
>
<!-- eslint-disable-next-line vue/no-v-html -->
<div v-if="!hydrated" v-html="question.content" />
<div v-else>
<html-renderer
class="html-typography"
:html="question.content || ''"
/>
</div>
<div class="html-typography" v-html="question.content || ''" />
<!-- <div v-if="!hydrated" v-html="question.content" /> -->
<!-- <div v-else> -->
<!-- <html-renderer -->
<!-- class="html-typography" -->
<!-- :html="question.content || ''" -->
<!-- /> -->
<!-- </div> -->
</el-collapse-item>
</el-collapse>
</div>

View File

@ -5,13 +5,14 @@
<div class="content">
<!-- eslint-disable-next-line vue/no-v-html -->
<div v-if="!hydrated" v-html="companyProfile.content || ''" />
<div v-else>
<html-renderer
class="html-typography"
:html="companyProfile.content || ''"
/>
</div>
<div class="html-typography" v-html="companyProfile.content || ''" />
<!-- <div v-if="!hydrated" v-html="companyProfile.content || ''" /> -->
<!-- <div v-else> -->
<!-- <html-renderer -->
<!-- class="html-typography" -->
<!-- :html="companyProfile.content || ''" -->
<!-- /> -->
<!-- </div> -->
</div>
<el-divider content-position="left">{{ $t('learn-more') }}</el-divider>

View File

@ -8,13 +8,14 @@
<div v-if="!pending" class="page-content">
<!-- eslint-disable-next-line vue/no-v-html -->
<div v-if="!hydrated" v-html="contactInfo?.content || ''" />
<div v-else>
<html-renderer
class="html-typography"
:html="contactInfo?.content || ''"
/>
</div>
<div class="html-typography" v-html="contactInfo?.content || ''" />
<!-- <div v-if="!hydrated" v-html="contactInfo?.content || ''" /> -->
<!-- <div v-else> -->
<!-- <html-renderer -->
<!-- class="html-typography" -->
<!-- :html="contactInfo?.content || ''" -->
<!-- /> -->
<!-- </div> -->
</div>
<div v-else class="loading">
<el-skeleton :rows="5" animated />