@@ -2,8 +2,9 @@ import * as React from 'react'
2
2
import { Button } from 'antd'
3
3
4
4
import MyIcon from './icon' ;
5
- import KeyCombiner from '../keyCombiner ' ;
5
+ import KeyEventListener from '../KeyEventListener ' ;
6
6
7
+ const { KeyCombiner } = KeyEventListener
7
8
declare var document : any ;
8
9
9
10
export interface FullScreenProps {
@@ -23,11 +24,11 @@ export default class FullScreenButton extends React.Component<FullScreenProps, a
23
24
/**
24
25
* 在一定情况下chrome不会触发resize事件,所以手动触发一下resize。
25
26
*/
26
- dispatchResizeEvent ( ) {
27
+ dispatchResizeEvent ( ) {
27
28
const event = new Event ( 'resize' ) ;
28
29
window . dispatchEvent ( event ) ;
29
30
}
30
- componentDidMount ( ) {
31
+ componentDidMount ( ) {
31
32
const { target } = this . props ;
32
33
const propsDom = document . getElementById ( target )
33
34
const domEle : any = propsDom || document . body ;
@@ -56,7 +57,7 @@ export default class FullScreenButton extends React.Component<FullScreenProps, a
56
57
domEle . onwebkitfullscreenchange = callBack ;
57
58
}
58
59
}
59
- componentWillUnmount ( ) {
60
+ componentWillUnmount ( ) {
60
61
const { target } = this . props ;
61
62
const propsDom = document . getElementById ( target )
62
63
const domEle : any = propsDom || document . body ;
@@ -103,7 +104,7 @@ export default class FullScreenButton extends React.Component<FullScreenProps, a
103
104
}
104
105
}
105
106
106
- render ( ) {
107
+ render ( ) {
107
108
const { themeDark, fullIcon, exitFullIcon, iconStyle, ...other } = this . props ;
108
109
const title = this . state . isFullScreen ? '退出全屏' : '全屏' ;
109
110
// const iconType = this.state.isFullScreen ? 'exit-fullscreen' : 'fullscreen';
0 commit comments