我正在尝试使用谷歌地图和插件https://www.npmjs.com/package/vue2-google-maps构建一个 vue 谷歌地图组件。我已经使用 npm 安装了插件,并且当我的 googleMap.vue 组件开始工作时:
-->
<!-- :center="{lat: 30.08674842, lng: -97.29304982}" -->
<GmapMap
:center="{lat: latitude, lng: longitude}"
:zoom="15"
map-type-id="terrain"
style="width: 500px; height: 300px"
>
</GmapMap>
</span>
</v-flex>
</v-container>
</div>
</template>
<script>
var latitute = 30.08674842
var longitude = -97.29304982
import {
gmapApi
} from 'vue2-google-maps'
export default {
// name:'myMap'
latitute:latitute,
longitude:longitude,
}
<
当我运行这个时,我得到:
ERROR [Vue warn]: Property or method "longitude" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property.
我怎样才能解决这个问题?
繁星点点滴滴
相关分类