Skip to content

Commit

Permalink
chore: restore git
Browse files Browse the repository at this point in the history
  • Loading branch information
yue1123 committed Apr 6, 2022
1 parent 93c0ade commit 702603b
Show file tree
Hide file tree
Showing 46 changed files with 6,746 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

# vuepress docs
.temp
.cache
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no -- commitlint --edit
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
shamefully-hoist=true
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Vue BaiduMap gl

基于百度地图 JavaScript GL 版 API 封装的 Vue3 组件库 施工中 🚧

<img src='./docs/.vuepress/public/logo.png' style="border-radius:48px;overflow:hidden; width:220px;">
<br />
<br />

[![GitHub license](https://img.shields.io/github/license/yue1123/img-previewer?style=flat-square)](https://github.com/yue1123/img-previewer/blob/main/LICENSE)

## todo list

- [x] 基础地图
- [x] 地图控件
- [ ] 地图覆盖物
- [ ] 地图插件
- [ ] 自定义地图样式
21 changes: 21 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'type-enum': [
2,
'always',
[
'feat', // 新功能 feature
'fix', // 修复 bug
'docs', // 文档注释
'style', // 代码格式(不影响代码运行的变动)
'refactor', // 重构(既不增加新功能,也不是修复bug)
'perf', // 性能优化
'test', // 增加测试
'chore', // 构建过程或辅助工具的变动
'revert', // 回退
'build' // 打包
]
]
}
}
75 changes: 75 additions & 0 deletions docs/.vuepress/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
import { defineUserConfig } from 'vuepress'
import type { DefaultThemeOptions } from 'vuepress'
import { capitalize, camelize } from 'vue'
const { resolve, join } = require('path')
const root = process.cwd()

import sidebarConfig from './sidebar.config'

export default defineUserConfig<DefaultThemeOptions>({
// 站点配置
lang: 'en-US',
title: 'Vue3 BaiduMap GL',
description: '一套基于Vue 3.0和百度地图的地图组件。',
// 主题和它的配置
theme: '@vuepress/theme-default',
themeConfig: {
logo: 'https://vuejs.org/images/logo.png',
navbar: [
{
text: '文档',
link: '/guide/install/'
},
{
text: '选择语言',
children: ['English', '简体中文']
},
{
text: '完整示例',
link: '/example/'
}
],
sidebar: {
'/guide/': [
{
text: '指南',
children: [
{
text: '安装',
link: '/guide/install'
},
{
text: '快速上手'
}
]
}
]
// '/reference/': [
// {
// text: 'Reference',
// children: ['/reference/cli.md', '/reference/config.md']
// }
// ]
}
},
plugins: [
[
'@vuepress/register-components',
{
componentsDir: resolve(__dirname, '../../src/lib/components'),
componentsPatterns: ['**/*.vue'],
getComponentName: (filename) => {
// 转驼峰
return camelize(capitalize(filename.replace(/\/\w+\.vue$/, '')))
}
}
]
],
alias: {
hooks: join(root, 'src/hooks'),
types: join(root, 'types')
},
bundlerConfig: {
base: './'
}
})
Binary file added docs/.vuepress/public/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions docs/.vuepress/sidebar.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const sidebarConfig = {
'/guide/': [
{
text: 'Guide',
children: ['/guide/README.md', '/guide/getting-started.md']
}
],
'/reference/': [
{
text: 'Reference',
children: ['/reference/cli.md', '/reference/config.md']
}
]
}

export default sidebarConfig
49 changes: 49 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
home: true
heroImage: /logo.png
heroText: Vue3 BaiduMap GL
actions:
- text: 开始使用
link: /docs/start
features:
- title: 基于Vue3 + vite
details: 面向未来
- title: Typescript 完整支持
details: 更好的组件类型提示
- title: 易用的组件
details: 与现实生活的流程、逻辑保持一致,遵循用户习惯的语言和概念
---

<input type="checkbox" v-model="mouseScroll"/>鼠标缩放
<button @click="count++">点我!</button>

<select name="" id="" v-model="type">
<option value="BMAP_NORMAL_MAP">BMAP_NORMAL_MAP</option>
<option value="BMAP_EARTH_MAP">BMAP_EARTH_MAP</option>
</select>

<script setup>
import { ref } from 'vue'
const msg = 'Markdown 中的 Vue'
const mouseScroll = ref(true)
const count = ref(10)
const type = ref('BMAP_NORMAL_MAP')
function syncCenterAndZoom(a) {
console.log(a)
}
function onReady(map){
console.log('我已准备就绪',map)
}
function onUnload(){
console.log('我卸载了')
}
</script>

<style>
.red-div {
color: red;
}
</style>

{{type}}
<baidu-map ak="4stE857hYPHbEmgKhLiTAa0QbCIULHpm" :mapType="type" @unload="onUnload" @initd="onReady" @aaa="syncCenterAndZoom" @mouseover="syncCenterAndZoom" :enableScrollWheelZoom="mouseScroll" :zoom="count"/>
Empty file added docs/guide/install.md
Empty file.
13 changes: 13 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite App</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
43 changes: 43 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"name": "vue3-baidu-map",
"private": true,
"version": "0.0.0",
"scripts": {
"dev": "vite --host",
"build": "vue-tsc --noEmit && vite build",
"preview": "vite preview",
"docs:dev": "vuepress dev docs",
"docs:build": "vuepress build docs"
},
"packageManager": "pnpm",
"dependencies": {
"mitt": "^3.0.0",
"vue": "^3.2.31"
},
"devDependencies": {
"@commitlint/cli": "^16.2.3",
"@commitlint/config-conventional": "^16.2.1",
"@vitejs/plugin-vue": "^2.2.0",
"@vuepress/plugin-register-components": "^2.0.0-beta.36",
"husky": "^7.0.4",
"less": "^4.1.2",
"typescript": "^4.5.4",
"vite": "^2.8.0",
"vue-tsc": "^0.29.8",
"vuepress": "^2.0.0-beta.36"
},
"engines": {
"node": ">=12.0.0"
},
"keywords": [
"vue3",
"vue",
"vue3-baidu-map"
],
"husky": {
"hooks": {
"pre-commit": "echo commit",
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
}
}
Loading

0 comments on commit 702603b

Please sign in to comment.