Skip to content

EShortcutPicker 快捷键 ​

import EUI 1.0

示例与代码 ​

快捷键 ​

QML 代码QML
效果
运行代码,体验组件交互

可修改文字、属性和事件,再点击运行。

代码在当前浏览器中运行 许可

属性 ​

属性说明取值与默认值
accessibleNamestring

辅助技术读取的名称;建议为无文字控件设置可读名称。

默认值placeholderText
appendComponentComponent

自定义输入附加区或列表尾部的 Component 插槽;null 使用默认内容。 委托上下文见本页示例。

默认值null
capturingbool

是否正在等待快捷键输入。

默认值false
clearIconint

组件使用的图标。

EIcons.*
0(无图标)

默认值EIcons.CIRCLE_XMARK
clearablebool

显示清除操作;评分中允许再次点击当前分数清零。

默认值true
echoModeenum

输入内容的显示模式。

TextInput.Normal
TextInput.Password
TextInput.NoEcho
TextInput.PasswordEchoOnEdit

默认值动态绑定
enabledbool

是否允许交互;false 时控件禁用。

默认值true
fontfont

字体配置,控制字体、字号及文字样式。

常用字段:
family、pixelSize、pointSize
bold、italic、weight
underline、strikeout
letterSpacing、wordSpacing

默认值应用字体
formattervar

格式化回调,把当前值转换为显示文字。

默认值null
heightreal

组件尺寸,单位为像素;可绑定父布局尺寸。

默认值implicitHeight
maximumLengthint

最多允许输入的字符数。

默认值32767
parservar

输入解析函数,把显示文字转换为底层值。

默认值null
passwordVisiblebool

密码是否以明文显示。

默认值false
placeholderTextstring

空值时显示的占位文字。

默认值随当前语言变化
prefixComponentComponent

自定义前缀的 Component 插槽;null 使用默认内容。 委托上下文见本页示例。

默认值null
prefixIconint

组件使用的图标。

EIcons.*
0(无图标)

默认值0
prependComponentComponent

自定义输入前置区的 Component 插槽;null 使用默认内容。 委托上下文见本页示例。

默认值null
readOnlybool

禁止用户编辑或评分,仍可通过属性设置值。

默认值true
sequencestring

当前键盘快捷键字符串。

默认值""
showPasswordbool

启用密码输入及密码显示切换。

默认值false
showWordLimitbool

显示当前字数与长度上限。

默认值false
sizeint

控件尺寸;默认继承最近的 EConfigProvider。

EStyle.Small
EStyle.Medium
EStyle.Large

默认值继承 Provider,默认 EStyle.Medium
styleTypeint

语义配色风格。

EStyle.Default
EStyle.Primary
EStyle.Success
EStyle.Info
EStyle.Warning
EStyle.Danger

默认值EStyle.Primary
suffixComponentComponent

自定义后缀的 Component 插槽;null 使用默认内容。 委托上下文见本页示例。

默认值null
suffixIconint

组件使用的图标。

EIcons.*
0(无图标)

默认值0
textstring

显示的文字内容。

默认值sequence
textColorcolor

文字颜色。

默认值动态绑定
validateEventbool

值变化时是否向所属表单派发校验请求。

默认值true
validationMessagestring

校验结果说明或外部错误文字。

默认值""
validationStateint

输入校验状态。

EValidationState.None
EValidationState.Success
EValidationState.Warning
EValidationState.Error

默认值EValidationState.None
visiblebool

是否显示组件。

默认值true
widthreal

组件尺寸,单位为像素;可绑定父布局尺寸。

默认值implicitWidth
hasValidationErrorbool只读

当前校验状态是否为 Error。

默认值由运行时计算
wordCountint只读

当前输入字符数量。

默认值由运行时计算
showPasswordStrengthbool

聚焦密码输入时显示强度与规则检查。

默认值false
passwordRulesvar

密码规则数组;每项包含 label 及 minLength 或 pattern。

默认值
展开默认值
[ {label: ELocale.texts.PasswordLength, minLength: 8}, {label: ELocale.texts.PasswordUppercase, pattern: /[A-Z]/}, {label: ELocale.texts.PasswordLowercase, pattern: /[a-z]/}, {label: ELocale.texts.PasswordNumber, pattern: /[0-9]/}, {label: ELocale.texts.PasswordSymbol, pattern: /[^A-Za-z0-9]/} ]
passwordStrengthreal只读

通过规则的比例,范围为 0 到 1。

默认值
展开默认值
passwordRequirements.length ? passwordRequirements.filter(function(rule) { return rule.passed }).length / passwordRequirements.length : 0
passwordRequirementsvar只读

包含 label 与 passed 的规则检查结果。

默认值
展开默认值
Array.isArray(passwordRules) ? passwordRules.map(function(rule) { let passed = false try { if (rule && rule.minLength !== undefined) passed = text.length >= Number(rule.minLength) else if (rule && rule.pattern) { const expression = new RegExp(rule.pattern) passed = expression.test(text) } } catch (error) { passed = false } return {label: rule && rule.label ? String(rule.label) : "", passed: passed} }) : []

信号 ​

签名作用
captured(string sequence)

录入快捷键后触发,sequence 为快捷键组合。

方法 ​

签名作用
cancel()

取消当前操作。

基于 MIT 许可发布 · 第三方资源遵循其各自许可