|
@@ -0,0 +1,21 @@
|
|
|
+// 全局混入map上的tip气泡点击除地图外的区域也进行隐藏
|
|
|
+export const mixinMapTip = {
|
|
|
+ mounted() {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.closedMapTip();
|
|
|
+ })
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ closedMapTip() {
|
|
|
+ if(this.$refs.supermap){
|
|
|
+ document.addEventListener("click", (e) => {
|
|
|
+ let a = this.$refs.supermap.$el;
|
|
|
+ if (this.$refs.supermap.mapshow && !a.contains(e.target)) {
|
|
|
+ this.$refs.supermap.mapshow = false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+ }
|
|
|
+}
|