Skip to content

Feat/tag input#114

Merged
duenyang merged 10 commits into
TDesignOteam:mainfrom
demoadminjie:feat/tag-input
Aug 30, 2024
Merged

Feat/tag input#114
duenyang merged 10 commits into
TDesignOteam:mainfrom
demoadminjie:feat/tag-input

Conversation

@demoadminjie
Copy link
Copy Markdown
Contributor

🤔 这个 PR 的性质是?

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

🔗 相关 Issue

#26

💡 需求背景和解决方案

📝 更新日志

  • feat(tag-input): 添加 tag-input 组件

  • 本条 PR 不需要纳入 Changelog

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

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

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jul 25, 2024

完成

@duenyang
Copy link
Copy Markdown
Contributor

image

@duenyang
Copy link
Copy Markdown
Contributor

image

@duenyang
Copy link
Copy Markdown
Contributor

image 对比react image

@duenyang
Copy link
Copy Markdown
Contributor

image

@duenyang
Copy link
Copy Markdown
Contributor

image

@duenyang
Copy link
Copy Markdown
Contributor

image

@duenyang
Copy link
Copy Markdown
Contributor

image image

@duenyang
Copy link
Copy Markdown
Contributor

image

Comment thread src/tag-input/type.ts
Comment on lines +2 to +3
import { InputProps } from '../input';
import { InputValue } from '../input';
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.

合为一个

Comment on lines +3 to +6
import inputStyles from '../../_common/style/web/components/input/_index.less';
import tagStyles from '../../_common/style/web/components/tag/_index.less';
import styles from '../../_common/style/web/components/tag-input/_index.less';
import theme from '../../_common/style/web/theme/_index.less';
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.

只引入对应组件的 less,和其它组件保持一致

onRemove: Function,
};

install() {
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.

放到类变量下面定义,类变量放在最前面

Comment on lines +115 to +121
this.tagInputRef = createRef();
this.isCompositionRef = createRef();
this.tagValue = this.props?.defaultValue || [];
this.draggingIndex = -1;
this.dragStartData = null;
this.isDropped = null;
this.startInfo = { nodeX: 0, nodeWidth: 0, mouseX: 0 };
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.

除了 this.tagValue ,其它的变量都可以在定义时设置默认值,无需在这里赋值

onMouseleave,
} = props;

const useDragSorter = <T,>(props: DragSortProps<T>): DragSortInnerProps => {
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.

提出来,不要每次render都重新定义

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.

render内太多函数逻辑,需要提取出来,只保留变量相关

@duenyang duenyang merged commit a214ab7 into TDesignOteam:main Aug 30, 2024
@demoadminjie demoadminjie mentioned this pull request Aug 30, 2024
16 tasks
This was referenced Oct 17, 2024
This was referenced Dec 16, 2024
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