This is a Vue.js component that represents a dashboard page with a map. It includes a template with a div that contains the app's content, a text element for the page title, and a div with an id of "mapContainer" for displaying the map.

The component also imports necessary dependencies, such as the mapGetters function from Vuex and vueHead for managing the page's head tags.

In the script section, the component is defined with a name of 'Dashboard'. It includes a computed property that maps the 'name' getter from the Vuex store.

In the mounted hook, the map is initialized using the AMap.Map constructor, with a zoom level of 13 and a center coordinate of [113.960057, 22.542714].

A marker is then added to the map using the AMap.Marker constructor, with a position of [113.960057, 22.542714], a reference to the map instance, and a title of '深圳' (Shenzhen).

In the head section, a script tag is added with a src attribute that loads the AMap JavaScript library from the webapi.amap.com CDN. The defer attribute is set to true, indicating that the script should be executed after the document has been parsed.

Finally, the component includes a scoped style section with some SCSS styles for the app container and text elements. The app-container class has flexbox properties for layout, while the app-text class sets the font size and line height

template div class=app-container div class=dashboard-text首页div div id=mapContainerdiv divtemplatescriptimport mapGetters from vueximport vueHead from vue-headexport default name Dashboard

原文地址: https://www.cveoy.top/t/topic/hLWS 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录