我想将 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