在使用vue3 + threejs开发的时候发现渲染的时候会报以下错误;
'get' on proxy: property 'modelViewMatrix' is a read-only and non-configurable data property on the proxy target but the proxy did not return its actual value (expected '#<Matrix4>' but got '#<Matrix4>')
原因是因为我们在vue3开发的时候习惯性定义属性用ref. ref会返回代理的对象,而不是源对象。
解决方案把定义属性的方法改为reactive即可!
const threeObj = ref(null) // 会出现问题
let threeObj = rective(null) // 问题解决