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

[comp: input] add input, textarea components #158

Closed
1 task done
danranVm opened this issue Jan 21, 2021 · 6 comments · Fixed by #172
Closed
1 task done

[comp: input] add input, textarea components #158

danranVm opened this issue Jan 21, 2021 · 6 comments · Fixed by #172
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@danranVm
Copy link
Member

danranVm commented Jan 21, 2021

  • I have searched the issues of this repository and believe that this is not a duplicate.

What problem does this feature solve?

  • 需要用户输入表单域内容时。
  • 提供组合型输入框,带搜索的输入框,还可以进行大小选择。

What does the proposed API look like?

ix-input

Props

除以下表格之外还支持原生 input 元素的所有属性

名称 说明 类型 默认值 全局配置 备注
v-model:value 控件值 string - - -
control 控件控制器 string|AbstractContro - - 当存在 control 时, 控件将由 AbstractControl 完全控制,此时 value 会失效
disabled 是否禁用状态 boolean false - -
addonAfter 设置后置标签 string|v-slot:addonAfter - - -
addonBefore 设置前置标签 string|v-slot:addonBefore - - -
suffix 设置后缀图标 string|v-slot:suffix - - -
prefix 设置前缀图标 string|v-slot:prefix - - -
size 设置大小 large|medium|small medium -
allowClear 是否清除图标 boolean false -
borderless 是否显示边框 boolean false -

Emits

名称 说明 参数类型 备注
suffixClick 后缀图标被点击 (value:string, evt: MouseEvent) => void -
prefixClick 前缀图标被点击 (value:string, evt: MouseEvent) => void -
afterClear 清除图标被点击后的回调 (evt: MouseEvent) => void -

ix-textarea

TextareaProps

除以下表格之外还支持原生 textarea 元素的所有属性

名称 说明 类型 默认值 全局配置 备注
v-model:value 控件值 string - - -
control 控件控制器 `string AbstractControl` - -
autoRows 是否显示自适应 rows boolean|{ minRows: number, maxRows: number } false -
showCharacterCount 是否展示字符数 boolean false -
maxCharacterCount 数字提示显示的最大值 number|string - 仅用于提示,不做校验控制
computeCharacterCount 自定义计算 characterCount 的函数 (v: string) => string - 优先级高于 maxCharacterCount
@danranVm danranVm added the enhancement New feature or request label Jan 21, 2021
@danranVm danranVm added this to the v1.0.0 milestone Jan 21, 2021
@danranVm danranVm mentioned this issue Jan 21, 2021
95 tasks
@zymoplastic
Copy link
Contributor

clear 是一个常见需求, 是不是可以考虑加进去, 这个图标的显示通常跟 inputhover 相关, 外部实现不是很方便

@zymoplastic
Copy link
Contributor

部分特殊按钮的回调可以提供一个事件出去, 不然用户需要透传监听所有的按键, 然后还要筛选它 key, 这个比较麻烦

@danranVm
Copy link
Member Author

clear 是一个常见需求, 是不是可以考虑加进去, 这个图标的显示通常跟 inputhover 相关, 外部实现不是很方便

hover 的时候 显示 clear 图标是吗?如果用户同时还设置了 suffix 应该是怎么样的一种行为?

@danranVm
Copy link
Member Author

部分特殊按钮的回调可以提供一个事件出去, 不然用户需要透传监听所有的按键, 然后还要筛选它 key, 这个比较麻烦

vue 本身已经对特殊键盘事件提供了回调,我觉得我们就没必要再做一个别名了吧。
参考 https://vue3js.cn/docs/zh/guide/events.html#%E6%8C%89%E9%94%AE%E5%88%AB%E5%90%8D

@zymoplastic
Copy link
Contributor

clear 是一个常见需求, 是不是可以考虑加进去, 这个图标的显示通常跟 inputhover 相关, 外部实现不是很方便

hover 的时候 显示 clear 图标是吗?如果用户同时还设置了 suffix 应该是怎么样的一种行为?

并排

@coolyuantao
Copy link
Member

  1. groupform-item功能有一定重叠,建议是不要了
  2. readonly会跟样式挂勾,建议也要
  3. computeCharacterCount这个建议是返回整串字符串
  4. 两个事件仅在icon下生效,clear也要加事件事件。插槽就没必要触发事件了

@danranVm danranVm changed the title [comp: input] add input, textarea and input-group components [comp: input] add input, textarea components Jan 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants