introduce Tencent Map plug-in into mpvue, no error reported and no map displayed.
app.json is at the same level as pages (written in src/main.js config.
"plugins": {
"mapPlugin": {
"version": "1.0.6",
"provider": "wx5bc2ac602a747594"
}
}
main.js of map.vue sibling
import Vue from "vue"
import App from "./index"
const app = new Vue(App)
app.$mount()
export default {
config: {
navigationBarTitleText: "",
usingComponents: {
"map-route": "plugin://mapPlugin/mapRoute"
}
}
};
map.vue
<!---->
<map-route :route-info="routeInfo"></map-route>
<script>
//js
let plugin = requirePlugin("mapPlugin")
export default {
data () {
return {
routeInfo: {}
}
},
mounted(){
let routeInfo = {
startLat: 39.90469, //
startLng: 116.40717, //
startName: "", //
endLat: 39.94055, //
endLng :116.43207, //
endName:"", //
mode: "car" //
};
this.routeInfo = routeInfo;
},
}
</script>