Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions apps/docs/content/3.api/4.utils/2.directives.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
title: Directives
description: TresJS provides custom made vue directives to help you creating your scenes.
---

# v-log

With the v-log directive provided by **TresJS**, you can do this by just adding `v-log` to the instance.

```vue{2, 11}
<script setup lang="ts">
import { TresCanvas, vLog } from '@tresjs/core'
import { OrbitControls, Sphere } from '@tresjs/cientos'
</script>
<template>
<TresCanvas >
<TresPerspectiveCamera :position="[0, 2, 5]" />
<Sphere
ref="sphereRef"
:scale="0.5"
v-log
/>
<OrbitControls v-log />
</TresCanvas>
</template>
```

## Arguments

Note that you can pass a modifier with the name of **any property**, for example:

```html
<!-- will log the materials -->
<Sphere v-log:material />
```

::prose-warning
The component `<TresCanvas >` will not log the canvas or the scene.
::
Loading