nuxt.md 2.0 KB

Nuxt 模块 @tresjs/nuxt

TresJS Nuxt Module

npm package

这里是 TresJS 的官方 Nuxt 模块🎉。

仓库在这里

安装

::: code-group

pnpm add three @tresjs/nuxt
npm install three @tresjs/nuxt
yarn add three @tresjs/nuxt

:::

特性

  • 🤓 从 TresJS 生态系统自动导入组件和组合式函数
  • TresCanvas 仅在客户端渲染,您无需为组件文件名添加 .client 或是使用 <ClientOnly />
  • 自动配置 vue 编译器支持 TresJS 组件,了解为什么
  • Nuxt 所有附带的开发体验魔法

使用方式

@tresjs/nuxt 添加到 nuxt.config.tsmodule 部分

export default defineNuxtConfig({
  modules: ['@tresjs/nuxt'],
})

就这样!你现在可以在你的 Nuxt 应用中开始使用 @tresjs/nuxt

如果你想使用TresJS生态系统中的任何包,你可以安装你想使用的包,它们将由模块自动导入🧙🏼。

包名 版本
Cientos cientos version
Post-processing post-processing version
# 使用 pnpm
pnpm add @tresjs/cientos @tresjs/post-processing