问题
I want to write a custom function in Google Sheet to generate barcodes. How do I import external js libraries (e.g. https://lindell.me/JsBarcode/)?
This is what have I so far:
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.
}
来源:https://stackoverflow.com/questions/52528295/how-to-use-js-libraries-in-google-sheet-app-script