如何在NUXT 3项目中使用troisjs
我想将troisjs
( vue for Vue)与
nuxt.js
一起使用。根据troisjs
文档( https://troisjs.github.io/guide/install.html#existing-vuejs-3-project )我需要将其添加到我的项目中:
import { TroisJSVuePlugin } from 'troisjs';
app.use(TroisJSVuePlugin);
但是,我不知道如何知道如何知道找出我应该放这个代码的地方
。 troisjs
而不是三。 介意使用它。
不要
I would like to use TroisJS
(three.js
wrapper for Vue) with Nuxt.js
. According to the TroisJS
documentation (https://troisjs.github.io/guide/install.html#existing-vuejs-3-project) I need to add it to my project like:
import { TroisJSVuePlugin } from 'troisjs';
app.use(TroisJSVuePlugin);
However, I don"t know how to figure out where I should put this code. I would expect the nuxt.config.js file, but I don't seem to quite get it where it should go.
I decided to use TroisJS
and not three.js
because I thought the former might be easier to import and use. If importing three.js
directly is easier, I don't mind using it.
Thank you very much for any help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在
/plugins
文件夹中添加新文件,名为troisjs-plugin.js
带有以下内容:In
/plugins
folder add new file namedtroisjs-plugin.js
with the following content :我找到了一个与TROIS和NUXT 3进行测试的回购,可能已经过时了,也许有些API已更改,但是如果您想检查一下: alvarosabu/nuxt3-trois
另外,Trois作者还有一个官方回购,其中有一个NUXT 3自定义插件(也可能已经过时)在这里 a>
I found a repo with some testing with Trois and Nuxt 3, probably outdated and maybe some apis have changed, but if you wanna check it out: alvarosabu/nuxt3-trois
Also, there's an official repo from the Trois author with a Nuxt 3 custom plugin (probably outdated too) here