当可编辑为 false 时 UI5 显示占位符 [英] UI5 display placeholder when editable is false
本文介绍了当可编辑为 false 时 UI5 显示占位符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用一个 Input 标签,其中 editable=false,但问题是占位符不可见.输入字段上有一个点击事件.有没有办法显示占位符.
I am using an Input tag where editable=false, but problem is placeholder is not visible. There's a click event on the input field. Is there a way to show placeholder.
推荐答案
假设您的字段名为email",那么您在 i18n 文件中写入占位符文本:
Let's say your field is called "email", then you write the placeholder text in the i18n file:
placeholder.email=Enter Email
在您的 XML 文件中使用 表达式绑定
In your XML file use Expression Binding
<Input type="Text" placeholder="{i18n>placeholder.email}" value="{= ${model>/email} === '' ? ${i18n>placeholder.email} : ${model>/email}}" editable="false"/>
如果值(model>/email
)为空,则该值将是占位符文本(i18n>placeholder.email
).
If the value(model>/email
) empty, the value will be the placeholder text(i18n>placeholder.email
).
表达式绑定
{= ${model>/email} === '' ? ${i18n>placeholder.email} : ${model>/email}}
这篇关于当可编辑为 false 时 UI5 显示占位符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文