安装
使用 npm 或 yarn 安装
我们推荐使用 npm
或 yarn
的方式进行开发,不仅可在开发环境轻松调试,也可放心地在生产环境打包部署使用,享受整个生态圈和工具链带来的诸多好处。
- npm
- Yarn
- pnpm
npm install @realsee/five three@0.117.1
yarn add @realsee/five three@0.117.1
pnpm add @realsee/five three@0.117.1
如果您使用 React Hooks API
,那么也请同时安装 React
的相关依赖。
- npm
- Yarn
- pnpm
npm install @realsee/five three@0.117.1 react
yarn add @realsee/five three@0.117.1 react
pnpm add @realsee/five three@0.117.1 react
如果您使用 Vue Composition API
,那么也请同时安装 Vue
的相关依赖。
- npm
- Yarn
- pnpm
npm install @realsee/five three@0.117.1 vue
yarn add @realsee/five three@0.117.1 vue
pnpm add @realsee/five three@0.117.1 vue
接下来便可以在您的项目使用 Five 引擎。
import { Five } from "@realsee/five";
// 如果您使用 React Hooks API
import { useFiveState } from "@realsee/five/react";
// 如果您使用 Vue Composition API
import { useFiveState } from "@realsee/five/vue";
Skypack
您也可以直接以 CDN 的方式引用 Five 依赖包。比如,针对支持 ES 模块的浏览器,可直接通过 Skypack 安装 Five 依赖: