Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: proxy app context #394

Merged
merged 12 commits into from
Sep 11, 2023
Prev Previous commit
Next Next commit
chore: combine imports
  • Loading branch information
alvarosabu committed Sep 11, 2023
commit 1fb06c24c6e182fd8e042690c6003972d9a779ca
4 changes: 2 additions & 2 deletions src/components/TresCanvas.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
ToneMapping,
} from 'three'
import type { Ref } from 'vue'
import {

Check failure on line 10 in src/components/TresCanvas.vue

View workflow job for this annotation

GitHub Actions / Lint (16)

Import "App" is only used as types
computed,
onMounted,
provide,
Expand All @@ -18,6 +18,8 @@
Fragment,
defineComponent,
h,
App,
getCurrentInstance

Check failure on line 22 in src/components/TresCanvas.vue

View workflow job for this annotation

GitHub Actions / Lint (16)

Missing trailing comma
} from 'vue'
import {
useTresContextProvider,
Expand All @@ -31,8 +33,6 @@

import type { RendererPresetsType } from '../composables/useRenderer/const'
import type { TresCamera, TresObject } from '../types/'
import { getCurrentInstance } from 'vue'
import { App } from 'vue'

export interface TresCanvasProps
extends Omit<WebGLRendererParameters, 'canvas'> {
Expand Down Expand Up @@ -83,13 +83,13 @@
default(): any
}>()

const vueApp = getCurrentInstance()?.appContext.app

Check failure on line 86 in src/components/TresCanvas.vue

View workflow job for this annotation

GitHub Actions / Lint (16)

Multiple spaces found before 'getCurrentInstance'

const createInternalComponent = (context: TresContext) =>
defineComponent({
setup() {
const ctx = getCurrentInstance()?.appContext
if(ctx) ctx.app = vueApp as App

Check failure on line 92 in src/components/TresCanvas.vue

View workflow job for this annotation

GitHub Actions / Lint (16)

Expected space(s) after "if"
provide('useTres', context)
provide('extend', extend)
return () => h(Fragment, null, slots?.default ? slots.default() : [])
Expand Down
Loading