to insert Baidu map into the vue project on the mobile phone, you need to achieve the effect in the diagram (network diagram), that is, search automatically when you modify it in the input box. Use the following link http://lbsyun.baidu.com/jsdem.
code is as follows, the map js file introduced in index.html
<script src="http://api.map.baidu.com/api?v=2.0&ak=ak"></script>
has the following two-end code in map.vue, but every time you change the value in contact-item, there is no search, and the page does not report an error. Would you please take a look at what"s going on? thank you.
<input type="text" class="contact-item-input" id="contact-item" :placeholder="defaultContact.name">
mounted(){
this.$nextTick(function(){
let map = new BMap.Map("map-area")
map.centerAndZoom("", 12)
let ac = new BMap.Autocomplete({
input: "contact-item",
location: map
})
//
let myValue
ac.addEventListener("onconfirm", function(e) {
let _value = e.item.value
myValue = _value.province + _value.city + _value.district + _value.street + _value.business
console.log("onconfirm<br />index = " + e.item.index + "<br />myValue = " + myValue)
// this.setPlace()
})
})
}