The mpvue applet obtains the user's geographic location login authorization simple package

# Embed html and code in the current page


<div class>
    <p>当前位置:{
   
   {currentLocation }}</p>
     <open_set
      v-if="show_setting"
      @close_setting="close_setting"
      @cb="setting_info"
    ></open_set>
    <div class="w_100 h150">
      <map
        class="w_100 h150"
        :latitude="map_info.lat"
        :longitude="map_info.lng"
        :markers="map_info.markers"
        show-location
        v-if="map_info.lat&&!show_device_modal && !show_setting"
      ></map>
    </div>
  </div>

## Introduce the open_set component on the current page


import open_set from "@/components/open_settin (需要在components中对象中引入) 
components: { open_set}

### The authorization panel appears first in the data show_setting: false,

#### Define events in methods

 close_setting() {
      this.show_setting = false;
    },
      setting_info() {
      this.show_setting = false;
      this.get_lbs();
    }

 

Guess you like

Origin blog.csdn.net/wei80231996/article/details/108601693