Skip to content

Feat/input select and keyboard events new#1915

Merged
haoziqaq merged 46 commits into
varletjs:devfrom
william-xue:feat/input-select-and-keyboard-events-new
Jul 17, 2025
Merged

Feat/input select and keyboard events new#1915
haoziqaq merged 46 commits into
varletjs:devfrom
william-xue:feat/input-select-and-keyboard-events-new

Conversation

@william-xue

@william-xue william-xue commented Jul 2, 2025

Copy link
Copy Markdown
Member

Checklist

List of tasks you have already done and plan to do.

  • Fix linting errors
  • Tests have been added / updated (or snapshots)

Change information

Describe your modifications here.

Issues

The issues you want to close, formatted as close #1912 .

Related Links

Links related to this pr.

@chouchouji

Copy link
Copy Markdown
Member

英文文档也要补充例子,commit 记录这个可以拉一下最新的 dev,根据这个创建一个新分支,把你的修改 cherry-pick 过去。

Comment on lines +84 to +88
<var-input
placeholder="按下回车键试试"
v-model="value15"
@enter="handleEnter"
/>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

这个不需要了

Comment thread packages/varlet-ui/src/input/docs/en-US.md
Comment on lines +29 to +34
const value15 = ref('')
const value16 = ref('')
const inputRef = ref()

const handleEnter = (value) => {
Snackbar.info(`回车键被按下,当前值:${value}`)
}

const selectAll = () => {
inputRef.value?.select()
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

文档修改一下,最好做下全面的自检,没必要的代码清理干净。

export default {
standard: 'Standard Variant',
outlined: 'Outlined Variant',
standard: 'Standard Appearance',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

这个应该就是 Variant,对应 props 属性。

haoziqaq and others added 7 commits July 10, 2025 15:37
- Add select() method to select all text in input

Closes varletjs#1912

docs(input): 移除输入组件文档中的键盘事件相关内容

refactor(input): 移除不必要的输入组件测试用例

refactor(input): 移除键盘事件处理器

refactor(input/example): 移除未使用的Snackbar导入

feat(input/docs): 添加en-US新的输入示例和选择全部功能

docs(input): 移除输入组件文档中的回车键事件示例

feat(input): add select method and clean up redundant code

- Add select() method to Input component for programmatic text selection
- Clean up redundant keyboard event handlers in examples and docs
- Fix variable naming consistency in documentation
- Remove unused handleEnter functions and value15 variables
- Update type definitions to include select method

docs(input/locale): 更新输入组件英文文档的术语描述

docs(input): 修正输入组件示例的英文翻译
添加outlinedInputRef引用和selectAllOutlined方法,使轮廓样式的输入框也能支持全选功能
@haoziqaq

Copy link
Copy Markdown
Member

可能需要合并一下最新的分支,我看你的 files changed 似乎有问题。

@haoziqaq haoziqaq merged commit c9b91ef into varletjs:dev Jul 17, 2025
5 of 6 checks passed
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.

input是否支持全选呢 以及 编辑框回车无法监听到回车事件

4 participants