我想在Google表格中编写自定义函数以生成条形码。如何导入外部js库(例如https://lindell.me/JsBarcode/)?
这是我到目前为止的事情:
function genBarcode(input) {
var url = "https://cdn.jsdelivr.net/jsbarcode/3.6.0/JsBarcode.all.min.js";
var js = UrlFetchApp.fetch(url).getContentText();
eval(js);
// I want to do something like this
// return JsBarcode("#barcode", "Hi world!");
// But Google sheet says JsBarcode is undefine.
}