diff --git a/docs/api/tres-canvas.md b/docs/api/tres-canvas.md index 78e8a6b4c..4dfd35b15 100644 --- a/docs/api/tres-canvas.md +++ b/docs/api/tres-canvas.md @@ -92,6 +92,7 @@ renderer.shadowMap.type = PCFSoftShadowMap | **toneMappingExposure** | Exposure level of tone mapping. | `1` | | **useLegacyLights** | Whether to use the legacy lighting mode or not | `true` | | **windowSize** | Whether to use the window size as the canvas size or the parent element. | `false` | +| **enableProvideBridge** | Enables the provide/inject bridge between Vue context and TresCanvas. | `true` | ### Defaults diff --git a/playground/.eslintrc-auto-import.json b/playground/.eslintrc-auto-import.json new file mode 100644 index 000000000..b2abc8dbd --- /dev/null +++ b/playground/.eslintrc-auto-import.json @@ -0,0 +1,67 @@ +{ + "globals": { + "Component": true, + "ComponentPublicInstance": true, + "ComputedRef": true, + "EffectScope": true, + "ExtractDefaultPropTypes": true, + "ExtractPropTypes": true, + "ExtractPublicPropTypes": true, + "InjectionKey": true, + "PropType": true, + "Ref": true, + "VNode": true, + "WritableComputedRef": true, + "computed": true, + "createApp": true, + "customRef": true, + "defineAsyncComponent": true, + "defineComponent": true, + "effectScope": true, + "getCurrentInstance": true, + "getCurrentScope": true, + "h": true, + "inject": true, + "isProxy": true, + "isReactive": true, + "isReadonly": true, + "isRef": true, + "markRaw": true, + "nextTick": true, + "onActivated": true, + "onBeforeMount": true, + "onBeforeUnmount": true, + "onBeforeUpdate": true, + "onDeactivated": true, + "onErrorCaptured": true, + "onMounted": true, + "onRenderTracked": true, + "onRenderTriggered": true, + "onScopeDispose": true, + "onServerPrefetch": true, + "onUnmounted": true, + "onUpdated": true, + "provide": true, + "reactive": true, + "readonly": true, + "ref": true, + "resolveComponent": true, + "shallowReactive": true, + "shallowReadonly": true, + "shallowRef": true, + "toRaw": true, + "toRef": true, + "toRefs": true, + "toValue": true, + "triggerRef": true, + "unref": true, + "useAttrs": true, + "useCssModule": true, + "useCssVars": true, + "useSlots": true, + "watch": true, + "watchEffect": true, + "watchPostEffect": true, + "watchSyncEffect": true + } +} diff --git a/playground/vue/components.d.ts b/playground/vue/components.d.ts index 81346d6a2..d72c00fd7 100644 --- a/playground/vue/components.d.ts +++ b/playground/vue/components.d.ts @@ -19,6 +19,7 @@ declare module 'vue' { Overlay: typeof import('./src/components/Overlay.vue')['default'] OverlayInfo: typeof import('./src/components/OverlayInfo.vue')['default'] PbrSphere: typeof import('./src/components/PbrSphere.vue')['default'] + ProvideBridge: typeof import('./src/components/ProvideBridge.vue')['default'] RouterLink: typeof import('vue-router')['RouterLink'] RouterView: typeof import('vue-router')['RouterView'] TakeOverLoopExperience: typeof import('./src/components/TakeOverLoopExperience.vue')['default'] diff --git a/playground/vue/src/App.vue b/playground/vue/src/App.vue index 1db6204f5..eab69b751 100644 --- a/playground/vue/src/App.vue +++ b/playground/vue/src/App.vue @@ -8,6 +8,10 @@ function setBodyClass(routeName: string) { document.body.className = routeName } watch([route], () => setBodyClass(route.name?.toString() ?? '')) +provide('v-route', route) +provide('useTres', { + message: `Im not the real useTres, but I can provide you with some data!`, +})