1- /* eslint-disable ts/ban-ts-comment */
21/* eslint-disable ts/no-redeclare */
32import type { ColorSource , Container , GpuPowerPreference } from 'pixi.js'
43import type { App , PropType } from 'vue-demi'
@@ -40,8 +39,8 @@ export const Application = defineComponent({
4039 resizeTo : Object as PropType < HTMLElement | Window | undefined > ,
4140 roundPixels : { type : Boolean , default : undefined } ,
4241 useBackBuffer : { type : Boolean , default : undefined } ,
43- width : { type : Number , default : undefined } ,
44- height : { type : Number , default : undefined } ,
42+ width : { type : [ Number , String ] , default : undefined } ,
43+ height : { type : [ Number , String ] , default : undefined } ,
4544 resolution : { type : Number , default : 1 } ,
4645
4746 // @TODO : Add webgl/webgpu
@@ -55,7 +54,13 @@ export const Application = defineComponent({
5554
5655 async function mount ( ) {
5756 const inst = new PixiApplication ( )
58- await inst . init ( { canvas : canvas . value , ...props , preference : 'webgl' } )
57+ await inst . init ( {
58+ canvas : canvas . value ,
59+ ...props ,
60+ preference : 'webgl' ,
61+ width : props . width ? Number ( props . width ) : undefined ,
62+ height : props . height ? Number ( props . height ) : undefined ,
63+ } )
5964
6065 pixiApp . value = markRaw ( inst )
6166
@@ -77,7 +82,6 @@ export const Application = defineComponent({
7782 app = undefined
7883
7984 pixiApp . value ?. destroy (
80- // @ts -ignore
8185 { releaseGlobalResources : true , removeView : true } ,
8286 {
8387 children : true ,
0 commit comments