Skip to content

fix(图表): 优化子弹图图例配置中图标配置的选择器长度#18145

Merged
jianneng-fit2cloud merged 1 commit intodev-v2from
pr@dev-v2@chart-bullet-graph-legend-style
Mar 26, 2026
Merged

fix(图表): 优化子弹图图例配置中图标配置的选择器长度#18145
jianneng-fit2cloud merged 1 commit intodev-v2from
pr@dev-v2@chart-bullet-graph-legend-style

Conversation

@jianneng-fit2cloud
Copy link
Copy Markdown
Contributor

What this PR does / why we need it?

Summary of your change

Please indicate you've done the following:

  • Made sure tests are passing and test coverage is added if needed.
  • Made sure commit message follow the rule of Conventional Commits specification.
  • Considered the docs impact and opened a new docs issue or PR with docs changes if needed.

>
<template #label>&nbsp;</template>
<el-select
:effect="themes"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

检查后发现代码中的一些不规范和潜在问题:

  1. 样式属性 width 的缺失
    <div> 元素的样式的修改部分,缺少了 width: 100% 属性。

  2. 最小宽度限制的添加
    对于缩放后的效果,增加一个 min-width: 0 来确保内容不会被压缩。

  3. 标签内容调整
    确保在 label 标签内包含有意义的内容(例如符号),避免不必要的空格或特殊字符影响布局。你可以考虑使用插槽来完全自定义 label 内容。

  4. 整体结构保持一致
    检查相邻元素是否在高度或行距上有任何区别,以避免视觉上的冲突。

以下是修正之后的代码片段示例:

<style scoped>
/* 确保其他地方没有遗漏相同的样式 */
@media (max-width: someBreakpoint) {
    /* 如果有更复杂的响应式需求,请在这里进行相应处理 */
}
</style>

<el-form-item
    :label="t('chart.icon')"
    class="form-item"
    :class="'form-item-' + themes'
    style="
        flex: 1;
        display: flex;
        width: 100%;
        position: relative;
        z-index: 200;
        overflow-x: hidden;"
>
    <!-- ... 避免直接设置宽度会导致滚动条出现 -->
</el-form-item>

请注意:为了达到更好的兼容性和性能优化,可以在 CSS 中设置适当的媒体查询和 Flexbox 布局规则,并根据具体情况进行微调。

@jianneng-fit2cloud jianneng-fit2cloud merged commit 5958d45 into dev-v2 Mar 26, 2026
4 of 5 checks passed
@jianneng-fit2cloud jianneng-fit2cloud deleted the pr@dev-v2@chart-bullet-graph-legend-style branch March 26, 2026 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants