Improve code

This commit is contained in:
Fawad Mirzad
2021-02-13 19:16:09 +01:00
parent 402a03b842
commit 01eee58476
2 changed files with 4 additions and 7 deletions

View File

@@ -1,9 +1,6 @@
/* vim: set softtabstop=2 shiftwidth=2 expandtab : */
<template> <template>
<div> <div>
<div ref="flyaway"> <div ref="infoWindow">
<!-- so named because it will fly away to another component -->
<slot> </slot> <slot> </slot>
</div> </div>
</div> </div>
@@ -51,12 +48,12 @@ export default mapElementFactory({
}, },
mounted() { mounted() {
const el = this.$refs.flyaway const el = this.$refs.infoWindow
el.parentNode.removeChild(el) el.parentNode.removeChild(el)
}, },
beforeCreate(options) { beforeCreate(options) {
options.content = this.$refs.flyaway options.content = this.$refs.infoWindow
if (this.$markerPromise) { if (this.$markerPromise) {
delete options.position delete options.position

View File

@@ -1,5 +1,5 @@
import lazy from './utils/lazyValue' import lazy from './utils/lazyValue'
import { loadGMapApi } from './manager' import { loadGMapApi } from './load-google-maps'
import { createApp } from 'vue' import { createApp } from 'vue'
import Marker from './components/marker' import Marker from './components/marker'
import Polyline from './components/polyline' import Polyline from './components/polyline'