【发布时间】:2018-02-23 16:05:03
【问题描述】:
我已经使用谷歌脚本创建了简单的 gmail 插件,因为我在这里遇到了困难,
我用的是简单的卡片,问题是,我们需要在卡片的中心对齐动作按钮并将css样式应用于TextInput
我参考了文档,但没有找到任何方法
下面的代码我试过了,
var card = CardService.newCardBuilder();
card.setHeader(CardService.newCardHeader().setTitle("Login Here"));
var section = CardService.newCardSection()
var cleint_id_Input = CardService.newTextInput()
.setFieldName("client_id")
.setTitle("Please enter clinet id")
var username_Input = CardService.newTextInput()
.setFieldName("username")
.setTitle("Please enter username")
var password_Input = CardService.newTextInput()
.setFieldName("password")
.setTitle("Please enter password")
section.addWidget(cleint_id_Input)
section.addWidget(username_Input)
section.addWidget(password_Input)
Logger.log("Input Value%s",cleint_id_Input)
//Login action button
var action = CardService.newAction().setFunctionName('loginCallback');
section.addWidget(CardService.newTextButton().setText('Login').setOnClickAction(action))
card.addSection(section)
提前致谢
【问题讨论】:
-
在 Apps Script 中没有做过太多 CSS 样式设置,但您可以参考他们的 CSS Package for Add-ons 和 HTML Service: Best Practices,因为其中涉及在 AS 中使用 CSS 的技巧。
标签: css google-apps-script gmail-addons