Sfoglia il codice sorgente

fix: minor clean up

alvarosabu 2 anni fa
parent
commit
50f685600f

+ 0 - 1
packages/tres/src/assets/vue.svg

@@ -1 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="37.07" height="36" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 198"><path fill="#41B883" d="M204.8 0H256L128 220.8L0 0h97.92L128 51.2L157.44 0h47.36Z"></path><path fill="#41B883" d="m0 0l128 220.8L256 0h-51.2L128 132.48L50.56 0H0Z"></path><path fill="#35495E" d="M50.56 0L128 133.12L204.8 0h-47.36L128 51.2L97.92 0H50.56Z"></path></svg>

+ 2 - 3
packages/tres/src/core/useRenderer/component.ts

@@ -31,11 +31,10 @@ export const TresCanvas = defineComponent({
 
     const { renderer, dispose, aspectRatio } = useRenderer(canvas, container, props)
 
-    provide('aspect-ratio', aspectRatio)
-    provide('renderer', renderer)
-
     const activeCamera = shallowRef()
 
+    provide('aspect-ratio', aspectRatio)
+    provide('renderer', renderer)
     provide('camera', activeCamera)
 
     if (slots.default && !slots.default().some(node => (node.type as TresVNodeType).name === 'Scene')) {

+ 7 - 3
packages/tres/src/index.ts

@@ -17,17 +17,21 @@ export interface TresPlugin {
 const plugin: TresPlugin = {
   install(app: App, options) {
     const prefix = options?.prefix || 'Tres'
+
+    // Register core components
     app.component(`${prefix}Canvas`, TresCanvas)
     app.component(`${prefix}Scene`, Scene)
+
+    // Initialize catalogue
     const { catalogue, extend } = useCatalogue(app, prefix)
     app.provide('catalogue', catalogue)
     app.provide('extend', extend)
     app.provide('useTres', useTres())
+
+    // Create components from catalogue
     const { createComponentInstances } = useInstanceCreator(prefix)
     const components = createComponentInstances(catalogue)
-    /*  const components = createComponentInstances(
-      options?.extends ? { ...catalogue, ...options.extends } : catalogue,
-    ) */
+
     components.forEach(([key, cmp]) => {
       app.component(key as string, cmp as Component)
     })