Javascript VueJS Google places自动完成

Javascript VueJS Google places自动完成,javascript,google-maps,google-maps-api-3,vue.js,googleplacesautocomplete,Javascript,Google Maps,Google Maps Api 3,Vue.js,Googleplacesautocomplete,嗨,伙计们,我在实现google自动完成时出错了。 下面是一个场景 蓝色的工作正常,但当我换成红色时,它就不工作了 现在当我把它放在红色箭头指向的线上时,我得到了这个错误 作为参考,我使用以下内容: 我也试过这个 工作正常,但当我把它放在回路上时,它就不工作了。看来 装载状态出错。这是我的密码 //this is the current I used this.$refs.address.focus(); //this is for the 2nd one /*this.autocomple

嗨,伙计们,我在实现google自动完成时出错了。 下面是一个场景 蓝色的工作正常,但当我换成红色时,它就不工作了 现在当我把它放在红色箭头指向的线上时,我得到了这个错误

作为参考,我使用以下内容: 我也试过这个

工作正常,但当我把它放在回路上时,它就不工作了。看来 装载状态出错。这是我的密码

//this is the current I used
this.$refs.address.focus();
//this is for the 2nd one
/*this.autocomplete = new google.maps.places.Autocomplete(
      (this.$refs.autocomplete),
      {types: ['geocode']}
    );
    this.autocomplete.addListener('place_changed', () => {
      let place = this.autocomplete.getPlace();
      let ac = place.address_components;
      let lat = place.geometry.location.lat();
      let lon = place.geometry.location.lng();
      let city = ac[0]["short_name"];

      console.log(`The user picked ${city} with the coordinates ${lat}, ${lon}`);
    });*/

用以下内容替换安装在机器内部的线路:

如果此。$refs.address此。$refs.address.focus


因为安装WorkHistory.vue组件时,自动完成组件放在v-for内,所以它不知道这是什么。$refs.address,除非work\u history\u数据至少有一项。

您能发布WorkHistory.vue的代码吗?整体thing@RuChernChong请到这儿来。我不能在这里加上对不起,谢谢