<GmapMarker :key="index" v-for="(m, index) in markers" :position="m.position" :clickable="true" :draggable="true" @click="center=m.position" /> </GmapMap> In yourmain.jsor inside a Nuxt plugin: importVuefrom'vue' import*asVueGoogleMapsfrom'vue2-google-maps' ...
现在你可以在任何 Vue 组件中使用 vue2-google-maps 提供的组件了。以下是一个简单的示例,展示如何在组件中使用 GmapMap 和GmapMarker: vue <template> <div> <GmapMap :center="center" :zoom="zoom" style="width: 100%; height: 400px;"> <GmapMarker :position="markerPosi...
/// If you want to manually install components, e.g. /// import {GmapMarker} from 'vue2-google-maps/src/components/marker' /// Vue.component('GmapMarker', GmapMarker) /// then disable the following: // installComponents: true, }) 下面就是地图的代码了,别着急(如下完整代码,我想你可能...
ENMarker类发出一个dragevent。与使用Vue的@drag(在模板中使用)不同,您可以使用the inheritedaddListener...