Tresjs / tres

Declarative ThreeJS using Vue Components
https://tresjs.org
MIT License
1.93k stars 86 forks source link

feat(app): 680 UseTexture composable as component #757

Open JaimeTorrealba opened 1 week ago

JaimeTorrealba commented 1 week ago

closes #680

Convert a composable like this one, as a component is not difficult, what I would like to know is what do you think about this one

Component Name

Vueuse, use the same name of the composable and seems to have no problem (the component start with uppercase), but what do you think? Could this confuse users? Any other alternatives.

useTexture and UseTexture

    <Suspense>
      <UseTexture v-slot="{ map }" :map="path">
        <TresMesh>
          <TresBoxGeometry />
          <TresMeshStandardMaterial :map="map" />
        </TresMesh>
      </UseTexture>
    </Suspense>

Props and result

They share the same name in the example they are :map="map" and the result currently is v-slot="{ map}"

I personally don't see any problem but again I would like to know what do you think?

Docs

I would not do the docs just yet, until your answers. But my idea is to put the docs of this just below the existing composable, any thoughts?

netlify[bot] commented 1 week ago

Deploy Preview for tresjs-docs ready!

Name Link
Latest commit e5b110b2cad2b3bafcc37628fa5d863e209b0ff1
Latest deploy log https://app.netlify.com/sites/tresjs-docs/deploys/6685a9de4f0fa500095dad98
Deploy Preview https://deploy-preview-757--tresjs-docs.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.