已弃用“ Google Apps脚本模板”。当在下面运行showSidebar代码时,它将在边栏中显示以下内容:
Hello, World! The time is .
=========================
function showSidebar() {
var ui = HtmlService.createHtmlOutputFromFile('index')
.setTitle('test');
SpreadsheetApp.getUi().showSidebar(ui);
}
=====================
<!DOCTYPE html>
<html>
<head>
<base target="_top">
</head>
<body>
Hello, World! The time is <?= new Date() ?>.
</body>
</html>
这是Google上有关应用程序脚本模板的文档的链接
https://developers.google.com/apps-script/guides/html/templates
答案 0 :(得分:2)
否,尚未弃用模板。
必须使用createHtmlOutputFromFile()
,而不是使用createHtmlTemplateFromFile()
,然后使用evaluate()
评估模板才能生成HtmlOutput。
此过程显示在您链接的文档的顶部。