-
全局安装typings
npm install -g typings
-
安装three.js库
npm install three
-
安装three.js的typescript语法(.d.ts)的依赖
npm install --save-dev @types/three
-
src根目录下的
shims-vue.d.ts
文件(没有则新建)添加declare module "@types/three";
这样设置后就会有Three.js代码补全和代码提示
VScode + Vue3 + Vite + Three.js 设置TypeScript语法提示
于 2022-03-31 17:42:48 首次发布