We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1799218 commit 3677496Copy full SHA for 3677496
examples/sites/public/static/js/design-common.js
@@ -27,6 +27,7 @@ const headerHtml = `
27
<span class="header-detail-name">TinyVue</span>
28
29
<div class="nav-menus nav-menus-left"></div>
30
+ <button id="switchTheme" style="margin-left:150px">切换主题</button>
31
</div>
32
33
</div>`
@@ -147,6 +148,10 @@ class DesignCommon {
147
148
link.href = '/static/css/design-common.css'
149
link.rel = 'stylesheet'
150
document.head.append(link)
151
+
152
+ document.getElementById('switchTheme').addEventListener('click', () => {
153
+ document.querySelector('html').classList.toggle('dark')
154
+ })
155
}
156
renderFooter() {
157
document.getElementById('footer').innerHTML = footerHtml
0 commit comments