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
Next Next commit
fix: proxy app context
  • Loading branch information
alvarosabu committed Sep 11, 2023
commit 128e3a5eb7af9c3d9b76f67e4afb19d6d0f550b0
6 changes: 6 additions & 0 deletions src/components/TresCanvas.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
Fragment,
defineComponent,
h,
} from 'vue'

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

View workflow job for this annotation

GitHub Actions / Lint (16)

'/home/runner/work/tres/tres/node_modules/vue/dist/vue.runtime.esm-bundler.js' imported multiple times
import {
useTresContextProvider,
useLogger,
Expand All @@ -31,6 +31,8 @@

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

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

View workflow job for this annotation

GitHub Actions / Lint (16)

`vue` import should occur before import of `../composables`

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

View workflow job for this annotation

GitHub Actions / Lint (16)

'/home/runner/work/tres/tres/node_modules/vue/dist/vue.runtime.esm-bundler.js' imported multiple times
import { App } from 'vue'

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

View workflow job for this annotation

GitHub Actions / Lint (16)

All imports in the declaration are only used as types. Use `import type`

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

View workflow job for this annotation

GitHub Actions / Lint (16)

`vue` import should occur before import of `../composables`

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

View workflow job for this annotation

GitHub Actions / Lint (16)

'/home/runner/work/tres/tres/node_modules/vue/dist/vue.runtime.esm-bundler.js' imported multiple times

export interface TresCanvasProps
extends Omit<WebGLRendererParameters, 'canvas'> {
Expand Down Expand Up @@ -81,9 +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