# MapGIS WebClient Vue3 Common

## 特性

- 开箱即用的高质量 Vue 3组件
- 丰富的文档和示例

## 安装

```
# npm
npm install ant-design-vue@^4.2.6
npm install @mapgis/webclient-common
npm install @mapgis/webclient-vue3-ui
npm install @mapgis/webclient-vue3-common

# yarn
yarn add ant-design-vue@^4.2.6
yarn add @mapgis/webclient-common
yarn add @mapgis/webclient-vue3-ui
yarn add @mapgis/webclient-vue3-common

# pnpm
pnpm add ant-design-vue@^4.2.6
pnpm add @mapgis/webclient-common
pnpm add @mapgis/webclient-vue3-ui
pnpm add @mapgis/webclient-vue3-common
```

## 用法

在 main.ts 中写入以下内容：

### 完整引入

```js
import { createApp } from 'vue'
import App from './App.vue'

import '@mapgis/webclient-common'

import Antd from 'ant-design-vue'
import MapGISUIComponents from '@mapgis/webclient-vue3-ui'
import MapGISCommonComponents from '@mapgis/webclient-vue3-common'

import 'ant-design-vue/dist/reset.css'
import '@mapgis/webclient-vue3-ui/dist/index.css'
import '@mapgis/webclient-vue3-common/dist/index.css'

createApp(App).use(Antd).use(MapGISUIComponents).use(MapGISCommonComponents).mount('#app')
```

### 按需导入

默认支持基于 ES modules 的 tree shaking，直接引入 import { Zoom } from '@mapgis/webclient-vue3-common'; 就会有按需加载的效果

```vue
<template>
  <a-config-provider>
    <mapgis-theme-provider>
      <Zoom></Zoom>
    </mapgis-theme-provider>
  </a-config-provider>
</template>

<script>
import { Zoom } from '@mapgis/webclient-vue3-common'
import '@mapgis/webclient-vue3-common/dist/theme/zoom.css'
</script>
```
