File tree 1 file changed +23
-1
lines changed
1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change 1
1
import React , { Component } from 'react' ;
2
- import { Layout } from 'antd' ;
2
+ import { Layout , notification , Icon } from 'antd' ;
3
3
import './style/index.less' ;
4
4
import SiderCustom from './components/SiderCustom' ;
5
5
import HeaderCustom from './components/HeaderCustom' ;
@@ -26,6 +26,28 @@ class App extends Component {
26
26
// console.log(document.body.clientWidth);
27
27
}
28
28
}
29
+ componentDidMount ( ) {
30
+ const openNotification = ( ) => {
31
+ notification . open ( {
32
+ message : '博主-yezihaohao' ,
33
+ description : (
34
+ < div >
35
+ < p >
36
+ GitHub地址: < a href = "https://github.com/yezihaohao" target = "_blank" rel = "noopener noreferrer" > https://github.com/yezihaohao</ a >
37
+ </ p >
38
+ < p >
39
+ 博客地址: < a href = "https://yezihaohao.github.io/" target = "_blank" rel = "noopener noreferrer" > https://yezihaohao.github.io/</ a >
40
+ </ p >
41
+ </ div >
42
+ ) ,
43
+ icon : < Icon type = "smile-circle" style = { { color : 'red' } } /> ,
44
+ duration : 0 ,
45
+ } ) ;
46
+ localStorage . setItem ( 'isFirst' , JSON . stringify ( true ) ) ;
47
+ } ;
48
+ const isFirst = JSON . parse ( localStorage . getItem ( 'isFirst' ) ) ;
49
+ ! isFirst && openNotification ( ) ;
50
+ }
29
51
getClientWidth = ( ) => { // 获取当前浏览器宽度并设置responsive管理响应式
30
52
const { receiveData } = this . props ;
31
53
const clientWidth = document . body . clientWidth ;
You can’t perform that action at this time.
0 commit comments