askbot-dragon 1.6.77 → 1.6.78

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "askbot-dragon",
3
- "version": "1.6.77",
3
+ "version": "1.6.78",
4
4
  "scripts": {
5
5
  "serve": "vue-cli-service serve",
6
6
  "build": "vue-cli-service build",
@@ -508,7 +508,10 @@ export default {
508
508
  // 等待 DOM 完全更新
509
509
  await this.$nextTick();
510
510
 
511
- if (!this.$refs.canvases || !Array.isArray(this.$refs.canvases)) {
511
+ const canvasRefs = this.$refs.canvases;
512
+ const canvasList = Array.isArray(canvasRefs) ? canvasRefs : (canvasRefs ? [canvasRefs] : []);
513
+
514
+ if (!canvasList.length) {
512
515
  console.warn('Canvas 引用未准备好,延迟重试');
513
516
  // 如果 canvas 引用还没准备好,延迟重试
514
517
  setTimeout(() => {
@@ -519,8 +522,8 @@ export default {
519
522
 
520
523
  // 确保所有 canvas 引用都已设置
521
524
  for (let index = 0; index < this.pages.length; index++) {
522
- if (this.$refs.canvases && this.$refs.canvases[index]) {
523
- this.$set(this.pages[index], 'canvas', this.$refs.canvases[index]);
525
+ if (canvasList[index]) {
526
+ this.$set(this.pages[index], 'canvas', canvasList[index]);
524
527
  } else {
525
528
  console.warn(`页面 ${index + 1} 的 canvas 引用不存在`);
526
529
  }