vue 组件报错 Error: Map container div not exist

 解决方法:
子组件接受父组件传值,使用watch监听加载

 props: {
    mapPop: {
      type: Boolean,
    },
  },
  watch: {
    mapPop() {
      this.$nextTick(() => {
        this.init();
        this.carinode();
      });
    },
  },

猜你喜欢

转载自blog.csdn.net/weixin_52630329/article/details/122302974