【问题标题】:Ember input helper placeholder not working for password and email typeEmber 输入助手占位符不适用于密码和电子邮件类型
【发布时间】:2016-06-27 02:34:15
【问题描述】:

我正在尝试为我的 Ember 应用创建注册和登录表单。我正在使用输入助手,但是当我为电子邮件和密码设置字段时,占位符文本以各自类型的格式出现,并且还将“值”显示为占位符文本,而不是定义的“占位符”文本。名字和姓氏字段以正确的格式显示正确的占位符文本。 这是我的注册模板中的代码:

{{input type="text" value=firstname id="firstname" placeholder="first name" autofocus="autofocus"}}
    {{input type="text" value=lastName placeholder="last name"}}
    {{input type="email" placeholder="email" value="emailAddress"}}
    {{input type="password" placeholder="password" value="password"}}
    {{input type="password" placeholder="confirm password" value="confirmPassword"}}

这是表单的结果:

任何想法如何解决这个问题?

【问题讨论】:

    标签: ember.js handlebars.js


    【解决方案1】:

    这是因为在密码的情况下传递给输入助手的值是一个字符串

    {{input type="password" placeholder="password" value="password"}}
    

    应该是

    {{input type="password" placeholder="password" value=password}}
    

    see this Twiddle

    【讨论】:

      猜你喜欢
      • 2015-11-28
      • 1970-01-01
      • 1970-01-01
      • 2015-08-02
      • 1970-01-01
      • 1970-01-01
      • 2014-07-05
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多