繁体   English   中英

无法使用 Angular-formly 关闭 Chrome 自动完成功能

[英]Can't turn off Chrome autocomplete using Angular-formly

我在这里发现我无法关闭 Chrome 自动完成功能。 我做了我必须做的一切,但 Chrome 的自动完成功能仍然有效。 无法理解我的错误在哪里以及我必须做些什么来解决它。 我的表单域:

const field_password = {
        key: 'password',
        type: 'input',
        wrapper: 'page-form-field',
        templateOptions: {
          placeholder: 'sigin.password.label',
          type: 'password',
          required: true,
          focus: $ctrl.isPasswordRecover,
        },
      };

  $ctrl.fields = [
    // ...,
    field_password
  ];

我的表格选项

  $ctrl.options = {
    removeChromeAutoComplete: true
  };

我的表格:

        formly-form(
          form   = '$ctrl.form',
          model  = '$ctrl.model',
          fields = '$ctrl.fields',
          options = '$ctrl.options'
        )

我的正式配置:

ction() {
  'use strict';

  angular
    .module('WebClientApp.formly', [])

    // Formly
    .config(function(formlyConfigProvider) {
    //...

    })
    .run(function(formlyConfig, formlyValidationMessages) {
      formlyConfig.extras.removeChromeAutoComplete = true;
  });
})();

这对我有用:

templateOptions: {
  label: 'COUNTRY',
  placeholder: 'Country',
  attributes: {
    autocomplete: 'off'
  },
  required: true,
}

在 HTML 中,将 autocomplete 属性设置为“off”。 正式提到的方法显然不再有效,或者至少在我尝试时没有。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM