[英]dat.GUI() constructor not working in three.js
I'm trying to use the dat.gui package in my three.js project. 我正在尝试在我的three.js项目中使用dat.gui包。 I've added it to my project with
yarn add dat.gui
and then I try to use it like: 我已经用
yarn add dat.gui
将其添加到我的项目中,然后尝试像这样使用它:
var dat = require("dat.gui");
var gui = new dat.GUI();
But I get the error: 但是我得到了错误:
index.js:8 Uncaught TypeError: dat.GUI is not a constructor
at init (index.js:8)
at Object.parcelRequire.2.three (index.js:4)
at newRequire (src.f4959abd.js:48)
at parcelRequire.4 (src.f4959abd.js:75)
at src.f4959abd.js:80
Anyone know why this might be happening? 有人知道为什么会这样吗?
What about 关于什么
var GUI = require("dat.gui");
var gui = new GUI();
Does that work? 那样有用吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.