小编Ken*_*nta的帖子

如何将 Three.js 导入我的 Nuxt 项目

我想将 THREE.js 中示例文件夹中的模块(例如 OBJLoader)导入到我的 Nuxt 项目中。

我可以导入三个的主文件夹,但是尝试在示例文件夹中导入模块时发生错误。

在官方文档中尝试了这些步骤。

https://threejs.org/docs/index.html#manual/en/introduction/Import-via-modules

我在下面收到错误

SyntaxError 意外标记 {

<template>
</template>
<script>
import * as THREE from 'three'
import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader.js';
export default{
}
</script>
Run Code Online (Sandbox Code Playgroud)

这是我的 github 存储库 https://github.com/ksuhara/threejs-test

three.js vue.js nuxt.js

3
推荐指数
2
解决办法
2670
查看次数

标签 统计

nuxt.js ×1

three.js ×1

vue.js ×1