我正在尝试 runkit.com 中的一个组件。从图像中可以看出,平台告诉我......
Fix: Use global instead of window. RunKit is a node environment, so window and other browser features won’t exist. If you’re just trying to access the global object, you can simply use global instead.
这是粘贴的代码:
var window = {};
const QueryQl = require("queryfilters/queryql")
var q = new QueryQl();
q.json({
'ciao': 'mondo'
});
q.getQueryString();
我该如何解决这个问题?
最佳答案
修复很简单。只需替换这个
window.module = window.module || {};
用这个:
global.module = global.module || {};
在模块中。
关于javascript - 修复 : Use global instead of window,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48126407/