【发布时间】:2018-11-11 22:26:51
【问题描述】:
我正在使用 Laravel 5.6.12 和 vue.js
I am implementtrying to implement Google Maps with the help of this github link
我遵循上面链接中提到的准则如下。
安装
npm install vue2-google-maps
然后在 app.js 中编写如下代码
import * as VueGoogleMaps from 'vue2-google-maps'
Vue.component('vue2-google-maps', VueGoogleMaps);
最后是模板中的代码
<GmapMap
:center="{lat:10, lng:10}"
:zoom="7"
map-type-id="terrain"
style="width: 500px; height: 300px"
></GmapMap>
我收到以下错误。
- 您是否正确注册了组件?对于递归 组件,请确保提供“名称”选项。
我已经在 html 头部添加了下面的脚本。
<script src="https://maps.googleapis.com/maps/api/js?key=apikey&libraries=places"></script>
我在上面的代码中遗漏了什么吗?
【问题讨论】:
标签: google-maps-api-3 vue.js laravel-5.6