Skip to content

Commit 411d2e7

Browse files
author
潘卓然Y7000P
committed
【站点】【修复】【修复帮助文档的路由监听】
1 parent b955094 commit 411d2e7

4 files changed

Lines changed: 45 additions & 16 deletions

File tree

website/src/components/IconFont/iconfont.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

website/src/router/index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,12 @@ export const routes = [
109109
],
110110
},
111111
{
112-
path: "/helper/:case",
112+
path: "/helper/:mapmode/:first/:file",
113+
component: Helper,
114+
name: "helper-views",
115+
},
116+
{
117+
path: "/helper/:mapmode/:first/:second/:file",
113118
component: Helper,
114119
name: "helper-views",
115120
},

website/src/views/helper/Helper.vue

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,18 +63,33 @@ export default {
6363
},
6464
methods: {
6565
getCurrentKind () {
66+
// let anchors = location.href.split("#");
67+
// if (!anchors || anchors.length < 2) return;
68+
69+
// let file = anchors[anchors.length - 1];
70+
// let mode = this.getMapMode();
71+
// let first, second;
72+
// if (anchors.length <= 4) {
73+
// first = anchors[anchors.length - 2];
74+
// second = undefined;
75+
// } else {
76+
// first = anchors[anchors.length - 3];
77+
// second = anchors[anchors.length - 2];
78+
// }
79+
6680
let anchors = location.href.split("#");
6781
if (!anchors || anchors.length < 2) return;
6882
69-
let file = anchors[anchors.length - 1];
83+
let hrefs = anchors[1].split("/").slice(2);
7084
let mode = this.getMapMode();
85+
let file = hrefs[hrefs.length - 1];
7186
let first, second;
72-
if (anchors.length <= 4) {
73-
first = anchors[anchors.length - 2];
74-
second = undefined;
75-
} else {
76-
first = anchors[anchors.length - 3];
77-
second = anchors[anchors.length - 2];
87+
if (hrefs.length <= 3) {
88+
first = hrefs[hrefs.length - 2];
89+
second = undefined;
90+
} else {
91+
first = hrefs[hrefs.length - 3];
92+
second = hrefs[hrefs.length - 2];
7893
}
7994
8095
this.resetHtml(mode, file, first, second);

website/src/views/layout/components/Header/config.js

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export const Headers = [
3131
title: '常见问题',
3232
hightlights: [[true]],
3333
links: [['OGC-WMTS']],
34-
routes: [['/helper/cesium#ogc#wmts#WMTS']]
34+
routes: [['/helper/cesium/ogc/wmts/WMTS']]
3535
},
3636
{
3737
title: '开发示例',
@@ -109,15 +109,19 @@ export const Headers = [
109109
menus: [
110110
{
111111
title: '常见问题',
112-
hightlights: [[true]],
113-
links: [['OGC-WMTS']],
114-
routes: [['/helper/mapboxgl#ogc#wmts#WMTS']]
112+
hightlights: [[true, true, true]],
113+
links: [['OGC-WMTS', '矢量瓦片-介绍','矢量瓦片-几何&符号']],
114+
routes: [
115+
['/helper/mapboxgl/ogc/wmts/WMTS',
116+
'/helper/mapboxgl/vectortile/index',
117+
'/helper/mapboxgl/vectortile/style']
118+
]
115119
},
116120
{
117121
title: '开发示例',
118122
hightlights: [
119123
[false, false, true, false, false, false, false, false, false, false, true, true],
120-
[true, true]
124+
[true, false, false, true]
121125
],
122126
links: [
123127
[
@@ -134,7 +138,7 @@ export const Headers = [
134138
'DataStore',
135139
'行业特色'
136140
],
137-
['Vue-栅格', 'Vue-交互']
141+
['Vue-图层', 'Vue-栅格', 'Vue-OGC', 'Vue-交互']
138142
],
139143
routes: [
140144
[
@@ -151,7 +155,12 @@ export const Headers = [
151155
'/gallery/mapboxgl#datastore#elasticsearch',
152156
'/gallery/mapboxgl#industry#search'
153157
],
154-
['/gallery/mapboxgl#vue#vue-raster', '/gallery/mapboxgl#vue#vue-control']
158+
[
159+
'/gallery/mapboxgl#vue#vue-layer',
160+
'/gallery/mapboxgl#vue#vue-raster',
161+
'/gallery/mapboxgl#vue#vue-ogc',
162+
'/gallery/mapboxgl#vue#vue-control'
163+
]
155164
]
156165
},
157166
{

0 commit comments

Comments
 (0)