fix: default

This commit is contained in:
ycjcl868 2019-12-23 17:44:02 +08:00
parent 60eca31754
commit 2f273546f4

View File

@ -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) {