1
0
mirror of https://github.com/troisjs/trois.git synced 2024-11-24 04:12:02 +08:00

renderer width/height type

This commit is contained in:
Kevin Levron 2022-03-16 18:11:22 +01:00
parent 74ae7137ad
commit 34ec0e8897

View File

@ -106,8 +106,8 @@ export default defineComponent({
pointer: { type: [Boolean, Object] as PropType<boolean | PointerPublicConfigInterface>, default: false }, pointer: { type: [Boolean, Object] as PropType<boolean | PointerPublicConfigInterface>, default: false },
resize: { type: [Boolean, String] as PropType<boolean | string>, default: false }, resize: { type: [Boolean, String] as PropType<boolean | string>, default: false },
shadow: Boolean, shadow: Boolean,
width: String, width: { type: [Number, String] },
height: String, height: { type: [Number, String] },
pixelRatio: Number, pixelRatio: Number,
xr: Boolean, xr: Boolean,
props: { type: Object, default: () => ({}) }, props: { type: Object, default: () => ({}) },
@ -142,8 +142,8 @@ export default defineComponent({
resize: props.resize, resize: props.resize,
} }
if (props.width) config.width = parseInt(props.width) if (props.width) config.width = parseInt(props.width as string)
if (props.height) config.height = parseInt(props.height) if (props.height) config.height = parseInt(props.height as string)
const three = useThree(config) const three = useThree(config)
bindObjectProp(props, 'props', three.renderer) bindObjectProp(props, 'props', three.renderer)