11<template >
22 <div ref =" component" class =" c-map" >
3- <div ref =" wrapper" class =" u -map__wrapper" :style =" wrapperSize" >
4- <div class =" u -map__inner" :style =" innerStyle" >
5- <img refs =" img" class =" u -map-img" :src =" mapImg" draggable =" false" />
6- <div class =" u -map-title__wrapper" v-if =" overview" >
3+ <div ref =" wrapper" class =" c -map__wrapper" :style =" wrapperSize" >
4+ <div class =" c -map__inner" :style =" innerStyle" >
5+ <img refs =" img" class =" c -map-img" :src =" mapImg" draggable =" false" />
6+ <div class =" c -map-title__wrapper" v-if =" overview" >
77 <slot name =" title" v-bind:title =" mapName" >
8- <div class =" u -map-title" >{{ mapName }}</div >
8+ <div class =" c -map-title" >{{ mapName }}</div >
99 </slot >
1010 </div >
1111 <template v-for =" (i , k ) in datas " >
12- <div class =" u -map-point__wrapper" :style =" pointStyle(i)" :key =" k" :data-index =" k" >
12+ <div class =" c -map-point__wrapper" :style =" pointStyle(i)" :key =" k" :data-index =" k" >
1313 <slot name =" point" v-bind:data =" i" >
14- <el-popover popper-class =" u -map-point__popover" placement =" top" width =" 200" trigger =" hover" >
14+ <el-popover popper-class =" c -map-point__popover" placement =" top" width =" 200" trigger =" hover" >
1515 <slot name =" popover" v-bind:data =" i" >
1616 <div >
17- <div v-if =" !overview" class =" u -map-title" >{{ mapName }}</div >
17+ <div v-if =" !overview" class =" c -map-title" >{{ mapName }}</div >
1818 <div >{{ i.title }}</div >
1919 <div v-html =" i.content" ></div >
2020 </div >
2121 </slot >
22- <span slot =" reference" class =" u -map-point" > </span >
22+ <span slot =" reference" class =" c -map-point" > </span >
2323 </el-popover >
2424 </slot >
2525 </div >
@@ -70,6 +70,10 @@ export default {
7070 type: Boolean ,
7171 default: true ,
7272 },
73+ centerPoint: {
74+ type: Object ,
75+ default: null ,
76+ },
7377 },
7478 data : () => ({
7579 outerWidth: 0 ,
@@ -96,6 +100,9 @@ export default {
96100 },
97101 // 中心点
98102 focusPoint () {
103+ if (this .centerPoint ) {
104+ return this .centerPoint ;
105+ }
99106 if (this .focus != undefined ) {
100107 return this .datas [this .focus ];
101108 } else {
@@ -248,8 +255,8 @@ export default {
248255 let store = {};
249256 const targetIsPoint = (e ) => {
250257 let { target } = e;
251- while (! target .classList .contains (" u -map__wrapper" )) {
252- if (target .classList .contains (" u -map-point__wrapper" )) {
258+ while (! target .classList .contains (" c -map__wrapper" )) {
259+ if (target .classList .contains (" c -map-point__wrapper" )) {
253260 store .pointIndex = Number (target .dataset [" index" ]);
254261 return true ;
255262 }
0 commit comments