feat: add form component#3912
Merged
jin0209 merged 15 commits intoTencent:developfrom Sep 10, 2025
Merged
Conversation
jin0209
reviewed
Sep 9, 2025
jin0209
reviewed
Sep 9, 2025
jin0209
reviewed
Sep 9, 2025
jin0209
reviewed
Sep 9, 2025
jin0209
reviewed
Sep 9, 2025
jin0209
reviewed
Sep 9, 2025
jin0209
reviewed
Sep 9, 2025
jin0209
reviewed
Sep 9, 2025
jin0209
reviewed
Sep 9, 2025
jin0209
reviewed
Sep 9, 2025
jin0209
approved these changes
Sep 9, 2025
commit: |
anlyyao
reviewed
Sep 10, 2025
|
|
||
| // options | ||
| const ignore = ['**/__test__/**', '**/_example/**', '**/node_modules/**']; | ||
| const ignore = ['**/__test__', '**/__test__/**', '**/_example/**', '**/packages/common/**', '**/node_modules/**']; |
Collaborator
There was a problem hiding this comment.
**/__test__/** 已经包含了 **/__test__
Collaborator
There was a problem hiding this comment.
打包不涉及common子仓库,**/packages/common/** 写进去没有实际意义,可移除
| @form-prefix: ~'@{prefix}-form'; | ||
|
|
||
| // Form 变量定义 | ||
| @form-bg-color: var(--td-form-bg-color, #ffffff); |
Collaborator
There was a problem hiding this comment.
可以直接用 @bg-color-container
| @form-bg-color: var(--td-form-bg-color, #ffffff); | ||
| @form-padding: var(--td-form-padding, 0); | ||
| @form-border-radius: var(--td-form-border-radius, 0); | ||
| @form-disabled-opacity: var(--td-form-disabled-opacity, 0.6); |
Collaborator
There was a problem hiding this comment.
现在只有 color、size、border 对外提供 css vars,opacity 暂不提供
| } | ||
|
|
||
| // 紧凑模式 | ||
| &--compact { |
| @@ -0,0 +1,5 @@ | |||
| <form | |||
| class="{{classPrefix}} {{classPrefix}}--{{labelAlign}} {{classPrefix}}--{{disabled ? 'disabled' : ''}} {{classPrefix}}--{{readonly ? 'readonly' : ''}} {{prefix}}-class" | |||
Collaborator
There was a problem hiding this comment.
组件统一支持了, style 属性和外部样式类 class。组件根节点上需要相应补齐
| const { prefix } = config; | ||
| const name = `${prefix}-form`; | ||
|
|
||
| Component({ |
Collaborator
There was a problem hiding this comment.
TD 重新封装了 wxComponent 装饰器和 SuperComponent 基类,统一处理了组件通用属性和特性。
@wxComponent()
export default class Form extends SuperComponent {
// 组件逻辑
}
anlyyao
reviewed
Sep 10, 2025
| clickHandle(e) { | ||
| let { name, path = '' } = e.detail.item as { | ||
| // 添加安全检查,确保e.detail存在 | ||
| if (!e.detail) { |
This was referenced Sep 24, 2025
Merged
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.
🤔 这个 PR 的性质是?
🔗 相关 Issue
#3726