Skip to content

Commit c7fec52

Browse files
committed
【example】新增组件知识图谱的例子;修复主题样式会闪烁一次的问题 review by luoxiao
1 parent de90eb2 commit c7fec52

File tree

5 files changed

+57
-9
lines changed

5 files changed

+57
-9
lines changed

build/jsdocs/template/tmpl/layout.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<meta charset="utf-8">
55
<script src="scripts/prettify/prettify.js"></script>
66
<script src="scripts/prettify/lang-css.js"></script>
7+
<script src="scripts/css-vars-ponyfill.min.js"></script>
78
<script src="../../examples/js/utils.js"></script>
89
<script src="../../examples/js/theme/themeConfig.js"></script>
910
<script src="../../examples/js/theme/theme.js"></script>
@@ -15,7 +16,6 @@
1516
<![endif]-->
1617
<script src="scripts/jquery.min.js"></script>
1718
<script src="scripts/adminlte/app.min.js"></script>
18-
<script src="scripts/css-vars-ponyfill.min.js"></script>
1919
<link type="text/css" rel="stylesheet" href="styles/bootstrap.min.css">
2020
<link type="text/css" rel="stylesheet" href="styles/adminlte/AdminLTE.min.css">
2121
<link type="text/css" rel="stylesheet" href="styles/adminlte/skin-blue.min.css">
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<!--********************************************************************
2+
* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
3+
*********************************************************************-->
4+
<!--********************************************************************
5+
* 该示例需要引入
6+
* vue-iclient (https://github.com/SuperMap/vue-iclient)
7+
* G6 (https://github.com/antvis/G6)
8+
*********************************************************************-->
9+
<!DOCTYPE html>
10+
<html>
11+
12+
<head>
13+
<meta charset="UTF-8">
14+
<title data-i18n='resources.title_componentsLegend_Vue'></title>
15+
<script type="text/javascript" include="vue" src="../js/include-web.js"></script>
16+
<script include="iclient-mapboxgl-vue,g6" src="../../dist/mapboxgl/include-mapboxgl.js"></script>
17+
<style>
18+
#main{
19+
margin: 0 auto;
20+
width: 100%;
21+
height: 100%;
22+
}
23+
</style>
24+
</head>
25+
26+
<body style=" margin: 0;overflow: hidden;background: #fff;width: 100%;height:100%;position: absolute;top: 0;">
27+
<div id="main">
28+
<sm-graph-map :service-url="url"></sm-graph-map>
29+
</div>
30+
<script>
31+
new Vue({
32+
el: '#main',
33+
data () {
34+
var host = window.isLocal ? window.server : 'https://iserver.supermap.io';
35+
return {
36+
url: host + '/iserver/services/knowledgeGraph-budongchan/restjsr/graph/graphmaps/图谱'
37+
}
38+
}
39+
})
40+
41+
</script>
42+
</body>
43+
44+
</html>

examples/component/config.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,13 @@ var exampleConfig = {
354354
version: '10.0.0',
355355
thumbnail: 'components_geojson_vue.png',
356356
fileName: 'components_geojson_vue'
357+
},
358+
{
359+
name: '知识图谱',
360+
name_en: 'Knowledge GraphMap',
361+
version: '11.1.0',
362+
thumbnail: 'knowledgeGraphMap.png',
363+
fileName: 'components_knowledgeGraphMap_vue'
357364
}
358365
]
359366
},
129 KB
Loading

examples/js/theme/theme.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,12 @@ function setRootStyle (theme) {
4747
rootStyleTag.innerHTML = rootStyle;
4848
}
4949

50-
var getCookie = utils.getCookie;
51-
document.addEventListener("DOMContentLoaded", function() {
52-
initSkin();
53-
});
50+
initSkin();
5451

5552
function initSkin() {
56-
var skin = getCookie('theme') || 'dark';
57-
var bodyElem = document.querySelector('body');
58-
bodyElem.classList.remove("light", "dark");
59-
bodyElem.classList.add(skin);
53+
var skin = utils.getCookie('theme') || 'dark';
54+
var rootElem = document.querySelector('html');
55+
rootElem.classList.remove("light", "dark");
56+
rootElem.classList.add(skin);
6057
setRootStyle(skin);
6158
}

0 commit comments

Comments
 (0)