Skip to content

Commit 2d2f26f

Browse files
committed
fix: fix size update
1 parent e108b39 commit 2d2f26f

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/model-mixin.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,6 @@ export default defineComponent({
145145
},
146146
data() {
147147
const result = {
148-
size: {
149-
width: this.width,
150-
height: this.height,
151-
},
152148
object: null as null | Object3D,
153149
raycaster: new Raycaster(),
154150
mouse: new Vector2(),
@@ -165,9 +161,13 @@ export default defineComponent({
165161
166162
// 确保这些对象不被转为 vue reactive 对象,避免 three 渲染出错
167163
Object.assign(this, result);
168-
164+
169165
// 为了保留类型信息,仍然返回 result 的 type
170166
return {
167+
size: {
168+
width: this.width,
169+
height: this.height,
170+
},
171171
progress: {
172172
isComplete: false,
173173
lengthComputable: false,

0 commit comments

Comments
 (0)