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/moment": "^2.13.0",
|
||||||
"@types/node": "^18.11.17",
|
"@types/node": "^18.11.17",
|
||||||
"@vitejs/plugin-vue": "^4.0.0",
|
"@vitejs/plugin-vue": "^4.0.0",
|
||||||
|
"@vuemap/unplugin-resolver": "^1.0.4",
|
||||||
"autoprefixer": "^10.4.13",
|
"autoprefixer": "^10.4.13",
|
||||||
"prettier": "^2.8.1",
|
"prettier": "^2.8.1",
|
||||||
"typescript": "^4.9.3",
|
"typescript": "^4.9.3",
|
||||||
|
|
|
@ -31,8 +31,16 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import { initAMapApiLoader } from '@vuemap/vue-amap';
|
||||||
|
import '@vuemap/vue-amap/dist/style.css';
|
||||||
import { EnvironmentOutlined } from '@ant-design/icons-vue';
|
import { EnvironmentOutlined } from '@ant-design/icons-vue';
|
||||||
|
|
||||||
|
initAMapApiLoader({
|
||||||
|
// key: '95fa72137f4263f8e64ae01f766ad09c',
|
||||||
|
key: 'a0415acfc35af15f10221bfa5a6850b4',
|
||||||
|
securityJsCode: 'cae6108ec3dd222f946d1a7237c78be0',
|
||||||
|
});
|
||||||
|
|
||||||
interface EmitProps {
|
interface EmitProps {
|
||||||
(e: 'update:point', data: string): void;
|
(e: 'update:point', data: string): void;
|
||||||
}
|
}
|
||||||
|
|
|
@ -100,7 +100,7 @@ interface EmitProps {
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
itemData: {
|
itemData: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: () => ({ type: 'object' }),
|
default: () => ({ type: 'geoPoint' }),
|
||||||
},
|
},
|
||||||
modelValue: {
|
modelValue: {
|
||||||
type: [Number, String],
|
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 'ant-design-vue/es/notification/style/css';
|
||||||
import Antd from 'ant-design-vue/es'
|
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)
|
const app = createApp(App)
|
||||||
|
|
||||||
app.use(store)
|
app.use(store)
|
||||||
app.use(router)
|
app.use(router)
|
||||||
app.use(components)
|
app.use(components)
|
||||||
app.use(Antd)
|
app.use(Antd)
|
||||||
app.use(VueAMap)
|
|
||||||
|
|
||||||
app.mount('#app')
|
app.mount('#app')
|
||||||
|
|
|
@ -5,6 +5,7 @@ import {AntDesignVueResolver} from 'unplugin-vue-components/resolvers'
|
||||||
import AutoImport from 'unplugin-auto-import/vite'
|
import AutoImport from 'unplugin-auto-import/vite'
|
||||||
import { createHtmlPlugin } from 'vite-plugin-html'
|
import { createHtmlPlugin } from 'vite-plugin-html'
|
||||||
import Config from './config/config'
|
import Config from './config/config'
|
||||||
|
import {VueAmapResolver} from '@vuemap/unplugin-resolver'
|
||||||
|
|
||||||
import * as path from 'path'
|
import * as path from 'path'
|
||||||
|
|
||||||
|
@ -46,7 +47,7 @@ export default defineConfig(({ mode}) => {
|
||||||
plugins: [
|
plugins: [
|
||||||
vue(),
|
vue(),
|
||||||
Components({
|
Components({
|
||||||
resolvers: [AntDesignVueResolver({ importStyle: 'less' })],
|
resolvers: [AntDesignVueResolver({ importStyle: 'less' }), VueAmapResolver()],
|
||||||
directoryAsNamespace: true
|
directoryAsNamespace: true
|
||||||
}),
|
}),
|
||||||
AutoImport({
|
AutoImport({
|
||||||
|
@ -54,7 +55,8 @@ export default defineConfig(({ mode}) => {
|
||||||
'vue',
|
'vue',
|
||||||
'vue-router'
|
'vue-router'
|
||||||
],
|
],
|
||||||
dts: 'src/auto-imports.d.ts'
|
dts: 'src/auto-imports.d.ts',
|
||||||
|
resolvers: [VueAmapResolver()],
|
||||||
}),
|
}),
|
||||||
createHtmlPlugin({
|
createHtmlPlugin({
|
||||||
inject: {
|
inject: {
|
||||||
|
|
Loading…
Reference in New Issue