Skip to content

Commit 862947d

Browse files
committed
【fix】修改主题存储方式为cookie review by luoxiao
1 parent 65392af commit 862947d

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

build/jsdocs/template/tmpl/layout.tmpl

Lines changed: 1 addition & 0 deletions
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="../../examples/js/utils.js"></script>
78
<script src="../../examples/js/theme/themeConfig.js"></script>
89
<script src="../../examples/js/theme/theme.js"></script>
910
<script type="text/javascript">

examples/js/theme/theme.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ document.addEventListener("DOMContentLoaded", function() {
5252
});
5353

5454
function initSkin() {
55-
var skin = window.sessionStorage.getItem('theme') || 'light';
55+
var skin = utils.getCookie('theme') || 'light';
5656
var bodyElem = document.querySelector('body');
5757
bodyElem.classList.remove("light", "dark");
5858
bodyElem.classList.add(skin);

0 commit comments

Comments
 (0)