Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Input): defaultValue 未使用 #2393

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open

Conversation

hmingv
Copy link

@hmingv hmingv commented Oct 12, 2023

🤔 这个 PR 的性质是?

  • [√] 日常 bug 修复
  • 新特性提交
  • 文档改进
  • 演示代码改进
  • 组件样式/交互改进
  • CI/CD 改进
  • 重构
  • 代码风格优化
  • 测试用例
  • 分支合并
  • 其他

🔗 相关 Issue

💡 需求背景和解决方案

📝 更新日志

  • fix(Input): defaultValue 未使用

  • [√] 本条 PR 不需要纳入 Changelog

☑️ 请求合并前的自查清单

⚠️ 请自检并全部勾选全部选项⚠️

  • [√] 文档已补充或无须补充
  • [√] 代码演示已提供或无须提供
  • [√] TypeScript 定义已补充或无须补充
  • [√] Changelog 已提供或无须提供

@hmingv hmingv changed the title fix(component): fix(Input): defaultValue 未使用 Oct 12, 2023
@@ -36,8 +36,8 @@ export default class Input extends SuperComponent {

lifetimes = {
ready() {
const { value } = this.properties;
this.updateValue(value == null ? '' : value);
const { value, defaultValue } = this.properties;
Copy link
Collaborator

Choose a reason for hiding this comment

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

组件库有提供 controlledProps 来实现组件的受控与非受控属性,可以直接使用,参考一下其他表单组件~

Copy link
Author

Choose a reason for hiding this comment

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

抱歉,我不是很明白您的意思,我是看文档中有 default-value 这个属性,并且标明了是 非受控属性,请问我应该如何使用它呢?

image

Copy link
Collaborator

@anlyyao anlyyao Nov 22, 2023

Choose a reason for hiding this comment

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

抱歉,我不是很明白您的意思,我是看文档中有 default-value 这个属性,并且标明了是 非受控属性,请问我应该如何使用它呢?

image

表单组件大多有受控和非受控,使用上可以具体参考switch组件 line32,https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/switch/switch.ts

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