瀏覽代碼

倾斜摄影页面加loading

任一存 3 年之前
父節點
當前提交
776a5407d2
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      src/views/ObliqueView.vue

+ 5 - 0
src/views/ObliqueView.vue

@@ -45,6 +45,7 @@ export default {
     this.setPanoData(panoData)
   },
   mounted() {
+    this.$msgCenter.publish('show-loading')
     this.initMap().then(
       (map) => {
         // 加载模型
@@ -60,9 +61,13 @@ export default {
           heading: 350,
           pitch: -43,
         })
+        setTimeout(() => {
+          this.$msgCenter.publish('hide-loading')
+        }, 3000)
       },
       (error) => {
         console.log("地图初始化失败", error)
+        this.$msgCenter.publish('hide-loading')
       }
     )
   },