liuyg
2022-03-22 e03c1cc18b888731130b92ad518a0dee6de2e479
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<template>
  <div>
    <avue-input-map
      :params="params"
      placeholder="请选择地点"
      v-model="chousePointData"
    ></avue-input-map>
  </div>
</template>
 
<script>
import mapOncePoint from "./mapOncePoint.vue";
export default {
  components: {
    mapOncePoint,
  },
  data() {
    return {
      params: {
        zoom: 10,
        // zoomEnable: false,
        // dragEnable: false,
      },
      chousePointData: [115.87179386, 28.74509276, ""],
    };
  },
  watch: {
    chousePointData: {
      handler(oldData, newData) {
        // setTimeout(() => {
        // if (
        //   this.chousePointData[0] &&
        //   this.chousePointData[1] &&
        //   this.chousePointData[2]
        // ) {
        this.$emit("setData", this.chousePointData);
        // } else {
        //   this.$message.error("未成功选择地点");
        //   this.$emit("setData", ["", "", ""]);
        // }
        // }, 500);
      },
      deep: true,
    },
  },
  methods: {
    openMaps(data) {
      this.chousePointData = [data.jd, data.wd, data.name];
    },
  },
};
</script>
 
<style lang="scss" scoped>
.myInputMap {
  width: 100%;
  height: 500px;
}
</style>