在CardService中创建密码字段

时间:2019-03-05 09:35:38

标签: google-apps-script google-apps-script-addon

我正在使用Google Apps脚本中的Card Service开发一个Gmail附件。我正在创建一个登录表单,我想“隐藏”密码字段中的字母

enter image description here

function createLoginSection() {

  var cardSection = CardService.newCardSection();

  var mail = CardService.newTextInput()
    .setFieldName('mail')
    .setTitle('Email');

  var password = CardService.newTextInput()
    .setFieldName('password')
    .setTitle('Password');

  var submitLogin = CardService.newAction().setFunctionName('submitLogin');
  var submitButton = CardService.newTextButton()
    .setText('ENVIAR')
    .setOnClickAction(submitLogin);

  cardSection.addWidget(mail);
  cardSection.addWidget(password);
  cardSection.addWidget(CardService.newButtonSet().addButton(submitButton));

  var cardHeader = CardService.newCardHeader()
    .setTitle("Identifícate");

  var card = CardService.newCardBuilder()
    .setName("Card name")
    .setHeader(cardHeader)
    .addSection(cardSection)
    .build();

  return card;
}

我正在搜索类似“ newPasswordInput”之类的字段...

有人可以帮助我吗?谢谢!

0 个答案:

没有答案