在我的Webpack项目中,我第一次尝试使用Polyglot,但一直收到没有定义polyglot的错误。我可以从某个节点导入它吗?或者我需要在本地导入它们?
var polyglot = new Polyglot();
polyglot.extend({
"hello": "Hello"
});
polyglot.t("hello");发布于 2019-01-09 19:44:41
在使用该模块之前,您必须导入或需要该模块。
import Polyglot from 'polyglot';
// const Polyglot = require('polyglot');
const polyglot = new Polyglot();
polyglot.extend({ "hello": "Hello" });
polyglot.t("hello");
https://stackoverflow.com/questions/54109244
复制相似问题