From 2f273546f435ddd06d79da0d3255d214df77bd95 Mon Sep 17 00:00:00 2001 From: ycjcl868 <45808948@qq.com> Date: Mon, 23 Dec 2019 17:44:02 +0800 Subject: [PATCH] fix: default --- site/theme/template/Layout/index.jsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/site/theme/template/Layout/index.jsx b/site/theme/template/Layout/index.jsx index bee092a2b8..5f5b2f9c6c 100644 --- a/site/theme/template/Layout/index.jsx +++ b/site/theme/template/Layout/index.jsx @@ -122,9 +122,13 @@ export default class Layout extends React.Component { } setTheme = theme => { + const componentPage = /^\/?components/.test(this.props.location.pathname); if (typeof window === 'undefined') { return; } + if (!componentPage) { + return 'default'; + } if (theme !== 'dark') { const dom = document.getElementById('theme-style'); if (dom) {