Skip to content

Commit

Permalink
docs: blog announcement for nuxt module
Browse files Browse the repository at this point in the history
  • Loading branch information
alvarosabu committed Jun 22, 2023
1 parent 45f454a commit 0858701
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
3 changes: 0 additions & 3 deletions docs/.vitepress/cache/deps_temp_9655456f/package.json

This file was deleted.

21 changes: 21 additions & 0 deletions docs/blog/announcing-tres-nuxt-module.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,27 @@ const { onLoop } = useRenderLoop()
</template>
```

### Client-side only

The `<TresCanvas>` is only loaded in the client-side, so you don't need to worry about **SSR** or **SSG** 😊.

### Vue compiler optimizations ⚙️

Automagically ✨ configure the Vue compiler to recognize the TresJS Components. This is because `<TresCanvas />` component creates a custom renderer for Vue, so we need to tell the outside Vue app to recognize the TresJS components.

Without the module you need to configure the Vue compiler like this:

```ts
export default defineNuxtConfig({
vue: {
compilerOptions: {
isCustomElement: tag => (tag.startsWith('Tres') && tag !== 'TresCanvas') || tag === 'primitive',
},
}
})
```

See more [here](http://tresjs.org/guide/troubleshooting.html#failed-resolve-component-trescomponent-%F0%9F%A4%94)

## Share your work 🎨

Expand Down

0 comments on commit 0858701

Please sign in to comment.