繁体   English   中英

dat.GUI()构造函数在three.js中不起作用

[英]dat.GUI() constructor not working in three.js

我正在尝试在我的three.js项目中使用dat.gui包。 我已经用yarn add dat.gui将其添加到我的项目中,然后尝试像这样使用它:

var dat = require("dat.gui");
var gui = new dat.GUI();

但是我得到了错误:

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

有人知道为什么会这样吗?

关于什么

var GUI = require("dat.gui");
var gui = new GUI();

那样有用吗?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM