Bootstrap

高德地图Marker增加自定义vue组件

this.content = '';
this.component && this.component.$destroy();
let _com = `<自定义组件></自定义组件>`;
let contentStr = `<div>` + _com +`</div>`

this.content = Vue.extend({
    template: contentStr,
    name: 'Com',
    components: {
        '自定义组件': 自定义组件
    },
});
this.component = new this.content().$mount();

this.marker=  new AMap.Marker({
    map: this.aMap,
    zIndex:135,
    content: this.component.$el,
    anchor: 'bottom-left',
    offset: [0, -this.$fontSize(0.08)],
    position:this.position,
});
;