From 34ec0e8897574a32a2ac1366e26dd8400e09bc9e Mon Sep 17 00:00:00 2001 From: Kevin Levron Date: Wed, 16 Mar 2022 18:11:22 +0100 Subject: [PATCH] renderer width/height type --- src/core/Renderer.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/Renderer.ts b/src/core/Renderer.ts index d741d5c..6488005 100644 --- a/src/core/Renderer.ts +++ b/src/core/Renderer.ts @@ -106,8 +106,8 @@ export default defineComponent({ pointer: { type: [Boolean, Object] as PropType, default: false }, resize: { type: [Boolean, String] as PropType, default: false }, shadow: Boolean, - width: String, - height: String, + width: { type: [Number, String] }, + height: { type: [Number, String] }, pixelRatio: Number, xr: Boolean, props: { type: Object, default: () => ({}) }, @@ -142,8 +142,8 @@ export default defineComponent({ resize: props.resize, } - if (props.width) config.width = parseInt(props.width) - if (props.height) config.height = parseInt(props.height) + if (props.width) config.width = parseInt(props.width as string) + if (props.height) config.height = parseInt(props.height as string) const three = useThree(config) bindObjectProp(props, 'props', three.renderer)