Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a541b0d

Browse files
author
huanglii
committed
chore: remove uuid
1 parent 4108e79 commit a541b0d

File tree

9 files changed

+30
-28
lines changed

9 files changed

+30
-28
lines changed

docs/.vuepress/components/common/code-view.vue

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,28 @@
1+
<script setup>
2+
defineProps({
3+
name: {
4+
type: String,
5+
required: true,
6+
},
7+
isCodeView: {
8+
type: Boolean,
9+
default: true,
10+
},
11+
})
12+
</script>
13+
114
<template>
215
<div class="code-view-wrapper">
316
<component :is="`map-${name}`"></component>
4-
<a v-if="isCodeView" class="link" :href="$withBase(`/example/${name}.html`)" target="_blank"
5-
>查看代码</a
6-
>
17+
<a v-if="isCodeView" class="link" :href="$withBase(`/example/${name}.html`)" target="_blank">查看代码</a>
718
</div>
819
</template>
920

10-
<script>
11-
export default {
12-
props: {
13-
name: {
14-
type: String,
15-
required: true,
16-
},
17-
isCodeView: {
18-
type: Boolean,
19-
default: true,
20-
},
21-
},
22-
}
23-
</script>
24-
2521
<style lang="scss" scoped>
2622
.code-view-wrapper {
2723
position: relative;
2824
margin: 10px 0;
25+
2926
.link {
3027
position: absolute;
3128
right: 10px;

docs/.vuepress/components/map/base-map.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
</template>
1010

1111
<script>
12-
import { v4 as uuidv4 } from 'uuid'
1312
import mapboxgl from 'mapbox-gl'
1413
import HomeControl from '../control/HomeControl'
1514
import { TK, STYLE } from '../../utils/constant'
@@ -39,7 +38,7 @@ export default {
3938
map: null,
4039
maploaded: false,
4140
mapDefaultOptions: {
42-
container: uuidv4(),
41+
container: Math.random().toString(16).substring(2),
4342
style: STYLE.DEFAULT,
4443
center: [104.294538, 35.860092],
4544
zoom: 2.4,

docs/.vuepress/components/map/start.vue renamed to docs/.vuepress/components/map/starter/globe.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script setup>
2-
import baseMap from './base-map.vue'
32
import { STYLE } from '@/utils/constant'
3+
import baseMap from '../base-map.vue'
44
55
const mapOptions = {
66
style: STYLE.SATELLITE,

docs/.vuepress/config.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export default defineUserConfig({
2727
theme: defaultTheme({
2828
logo: '/assets/logo.png',
2929
navbar: [
30-
{ text: '快速开始', link: '/getting-started/' },
30+
{ text: '快速开始', link: '/starter/' },
3131
{ text: '样式规范', link: '/style-spec/' },
3232
{ text: '地图服务', link: '/service/' },
3333
{ text: '空间数据', link: '/data/' },
@@ -44,10 +44,10 @@ export default defineUserConfig({
4444
sidebarDepth: 2,
4545
// sidebar: 'auto',
4646
sidebar: {
47-
'/getting-started/': [
47+
'/starter/': [
4848
{
4949
text: '快速开始',
50-
link: '/getting-started/',
50+
link: '/starter/',
5151
},
5252
{
5353
text: '术语',

docs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ heroText: Mapbox GL JS Cookbook
55
tagline: 地理信息可视化
66
actions:
77
- text: 快速开始
8-
link: /getting-started/
8+
link: /starter/
99
type: primary
1010
- text: 样式规范
1111
link: /style-spec/

docs/example/starter-globe.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<ClientOnly>
2+
<common-code-view name="starter-globe" :is-code-view="false"/>
3+
</ClientOnly>
4+
5+
@[code vue](../.vuepress/components/map/starter/globe.vue)

docs/getting-started/README.md renamed to docs/starter/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ const map = new mapboxgl.Map({
2929
})
3030
```
3131

32-
<map-start />
32+
<ClientOnly>
33+
<common-code-view name="starter-globe"/>
34+
</ClientOnly>
3335

3436
> 示例:[Display a globe on a webpage](https://docs.mapbox.com/mapbox-gl-js/example/simple-map/)
File renamed without changes.

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
"geojson-validation": "^1.0.2",
4141
"mapbox-gl": "^2.9.1",
4242
"proj4": "^2.8.0",
43-
"three": "^0.132.2",
44-
"uuid": "^8.3.2"
43+
"three": "^0.132.2"
4544
}
4645
}

0 commit comments

Comments
 (0)