fix: 高德地图完整导入改为自动导入
This commit is contained in:
parent
7fe7d70b21
commit
3fbb1dd312
File diff suppressed because it is too large
Load Diff
|
@ -30,6 +30,7 @@
|
|||
"@types/moment": "^2.13.0",
|
||||
"@types/node": "^18.11.17",
|
||||
"@vitejs/plugin-vue": "^4.0.0",
|
||||
"@vuemap/unplugin-resolver": "^1.0.4",
|
||||
"autoprefixer": "^10.4.13",
|
||||
"prettier": "^2.8.1",
|
||||
"typescript": "^4.9.3",
|
||||
|
|
|
@ -31,8 +31,16 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { initAMapApiLoader } from '@vuemap/vue-amap';
|
||||
import '@vuemap/vue-amap/dist/style.css';
|
||||
import { EnvironmentOutlined } from '@ant-design/icons-vue';
|
||||
|
||||
initAMapApiLoader({
|
||||
// key: '95fa72137f4263f8e64ae01f766ad09c',
|
||||
key: 'a0415acfc35af15f10221bfa5a6850b4',
|
||||
securityJsCode: 'cae6108ec3dd222f946d1a7237c78be0',
|
||||
});
|
||||
|
||||
interface EmitProps {
|
||||
(e: 'update:point', data: string): void;
|
||||
}
|
||||
|
|
|
@ -100,7 +100,7 @@ interface EmitProps {
|
|||
const props = defineProps({
|
||||
itemData: {
|
||||
type: Object,
|
||||
default: () => ({ type: 'object' }),
|
||||
default: () => ({ type: 'geoPoint' }),
|
||||
},
|
||||
modelValue: {
|
||||
type: [Number, String],
|
||||
|
|
10
src/main.ts
10
src/main.ts
|
@ -7,21 +7,11 @@ import './style.css'
|
|||
import 'ant-design-vue/es/notification/style/css';
|
||||
import Antd from 'ant-design-vue/es'
|
||||
|
||||
// 地图
|
||||
import VueAMap, { initAMapApiLoader } from '@vuemap/vue-amap';
|
||||
import '@vuemap/vue-amap/dist/style.css'
|
||||
initAMapApiLoader({
|
||||
// key: '95fa72137f4263f8e64ae01f766ad09c',
|
||||
key: 'a0415acfc35af15f10221bfa5a6850b4',
|
||||
securityJsCode: 'cae6108ec3dd222f946d1a7237c78be0'
|
||||
})
|
||||
|
||||
const app = createApp(App)
|
||||
|
||||
app.use(store)
|
||||
app.use(router)
|
||||
app.use(components)
|
||||
app.use(Antd)
|
||||
app.use(VueAMap)
|
||||
|
||||
app.mount('#app')
|
||||
|
|
|
@ -5,6 +5,7 @@ import {AntDesignVueResolver} from 'unplugin-vue-components/resolvers'
|
|||
import AutoImport from 'unplugin-auto-import/vite'
|
||||
import { createHtmlPlugin } from 'vite-plugin-html'
|
||||
import Config from './config/config'
|
||||
import {VueAmapResolver} from '@vuemap/unplugin-resolver'
|
||||
|
||||
import * as path from 'path'
|
||||
|
||||
|
@ -46,7 +47,7 @@ export default defineConfig(({ mode}) => {
|
|||
plugins: [
|
||||
vue(),
|
||||
Components({
|
||||
resolvers: [AntDesignVueResolver({ importStyle: 'less' })],
|
||||
resolvers: [AntDesignVueResolver({ importStyle: 'less' }), VueAmapResolver()],
|
||||
directoryAsNamespace: true
|
||||
}),
|
||||
AutoImport({
|
||||
|
@ -54,7 +55,8 @@ export default defineConfig(({ mode}) => {
|
|||
'vue',
|
||||
'vue-router'
|
||||
],
|
||||
dts: 'src/auto-imports.d.ts'
|
||||
dts: 'src/auto-imports.d.ts',
|
||||
resolvers: [VueAmapResolver()],
|
||||
}),
|
||||
createHtmlPlugin({
|
||||
inject: {
|
||||
|
|
Loading…
Reference in New Issue