瀏覽代碼

docs: api docs

alvarosabu 2 年之前
父節點
當前提交
92e8ce934c
共有 3 個文件被更改,包括 18 次插入20 次删除
  1. 15 15
      docs/api/composables.md
  2. 1 1
      docs/api/events.md
  3. 2 4
      docs/api/renderer.md

+ 15 - 15
docs/api/composables.md

@@ -127,17 +127,19 @@ Then you can bind the textures to the material.
 
 
 ```vue
 ```vue
 <template>
 <template>
-  <TresMesh>
-    <TresMeshSphereGeometry />
-    <TresMeshStandardMaterial
-      :map="map"
-      :displacementMap="displacementMap"
-      :normalMap="normalMap"
-      :roughnessMap="roughnessMap"
-      :metalnessMap="metalnessMap"
-      :aoMap="aoMap"
-    />
-  </TresMesh>
+  <TresCanvas>
+    <TresMesh>
+      <TresMeshSphereGeometry />
+      <TresMeshStandardMaterial
+        :map="map"
+        :displacementMap="displacementMap"
+        :normalMap="normalMap"
+        :roughnessMap="roughnessMap"
+        :metalnessMap="metalnessMap"
+        :aoMap="aoMap"
+      />
+    </TresMesh>
+  </TresCanvas>
 </template>
 </template>
 ```
 ```
 
 
@@ -163,14 +165,12 @@ Then you can use the new component in your template. Notice that the new compone
 ```vue
 ```vue
 <template>
 <template>
   <TresCanvas shadows alpha>
   <TresCanvas shadows alpha>
-    <TresScene>
-      <TresOrbitControls v-if="state.renderer" :args="[state.camera, state.renderer?.domElement]" />
-    </TresScene>
+    <TresOrbitControls v-if="state.renderer" :args="[state.camera, state.renderer?.domElement]" />
   </TresCanvas>
   </TresCanvas>
 </template>
 </template>
 ```
 ```
 
 
-## useTres <Badge type="warning" text="^1.7.0" />
+## useTres
 
 
 This composable aims to provide access to the state model which contains the default renderer, camera, scene, and other useful properties.
 This composable aims to provide access to the state model which contains the default renderer, camera, scene, and other useful properties.
 
 

+ 1 - 1
docs/api/events.md

@@ -1,4 +1,4 @@
-# Events <Badge type="warning" text="^1.6.0" />
+# Events
 
 
 **TresJS** Mesh objects emit pointer events when they are interacted with using `raycaster` and `pointer` objects under the hood.
 **TresJS** Mesh objects emit pointer events when they are interacted with using `raycaster` and `pointer` objects under the hood.
 
 

+ 2 - 4
docs/api/renderer.md

@@ -2,13 +2,11 @@
 
 
 The `Renderer` component is the main component of Tres. It's the one that creates the ThreeJS `WebGLRenderer` and define your Tres Scene.
 The `Renderer` component is the main component of Tres. It's the one that creates the ThreeJS `WebGLRenderer` and define your Tres Scene.
 
 
-```vue{2,7}
+```vue{2,5}
 <template>
 <template>
   <TresCanvas shadows :output-encoding="sRGBEncoding">
   <TresCanvas shadows :output-encoding="sRGBEncoding">
     <TresPerspectiveCamera />
     <TresPerspectiveCamera />
-    <TresScene>
       <!-- Your scene goes here -->
       <!-- Your scene goes here -->
-    </TresScene>
   </TresCanvas>
   </TresCanvas>
 </template>
 </template>
 ```
 ```
@@ -42,7 +40,7 @@ body {
 }
 }
 ```
 ```
 
 
-## Presets <Badge warning text="v1.7.0+" />
+## Presets
 
 
 Tres comes with a few presets for the `Renderer` component. You can use them by setting the `preset` prop.
 Tres comes with a few presets for the `Renderer` component. You can use them by setting the `preset` prop.