Skip to content

Commit

Permalink
fix: proxy app context
Browse files Browse the repository at this point in the history
  • Loading branch information
alvarosabu committed Sep 11, 2023
1 parent 924407e commit 128e3a5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/components/TresCanvas.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ import { render } from '../core/renderer'
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 @@ const slots = defineSlots<{
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

0 comments on commit 128e3a5

Please sign in to comment.