fix(step): 兼容 title/description 空值样式 (#882)#1002
Closed
wanchun wants to merge 1 commit into
Closed
Conversation
Collaborator
Author
|
Closed as part of v3 rebuild from chore/test-infra. Original v1/v2 PRs being superseded by clean re-implementation (vitest + playwright + docs). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
修复内容
Step 组件当
title或description为空字符串/undefined 时,空 div 仍会渲染(带着 margin/padding),造成标题区有偏移的视觉问题。根因(
components/steps/step.tsx渲染函数):{slots.title?.() ||${props.title}}—— undefined 被 stringified 成 "undefined",empty 字符串也通过||fallback&&守卫,只对内容有<div class="...-title">和<div class="...-description">始终渲染修复:
(slots.title || props.title) &&守卫,有内容才渲染${props.title}→props.title ??(避免 undefined 被渲染为字面 "undefined")验证
PATH="$HOME/.nvm/versions/node/v22.22.3/bin:$PATH" ./node_modules/.bin/vitest run components/steps改动文件
components/steps/step.tsx— 渲染函数加守卫components/steps/__tests__/step-882.spec.ts— 4 个 vitest 单测无 lockfile 污染,无 test infra 修改。
Closes #882