|
@@ -1,6 +1,6 @@
|
|
|
import { Drawer } from 'antd'
|
|
import { Drawer } from 'antd'
|
|
|
import { connect } from 'dva'
|
|
import { connect } from 'dva'
|
|
|
-import React, { useState, Fragment, useEffect } from 'react'
|
|
|
|
|
|
|
+import React, { Fragment, useEffect } from 'react'
|
|
|
|
|
|
|
|
const BasicDrawer = props => {
|
|
const BasicDrawer = props => {
|
|
|
const {
|
|
const {
|
|
@@ -8,20 +8,25 @@ const BasicDrawer = props => {
|
|
|
config: { children, ...resetProps }
|
|
config: { children, ...resetProps }
|
|
|
} = props
|
|
} = props
|
|
|
// 浏览器实际宽度
|
|
// 浏览器实际宽度
|
|
|
- const [clientWidth, setClientWidth] = useState(document.body.clientWidth * 0.75)
|
|
|
|
|
|
|
+ // const [clientWidth, setClientWidth] = useState(document.body.clientWidth * 0.75)
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
|
- window.addEventListener('resize', () => {
|
|
|
|
|
- setClientWidth(document.body.clientWidth * 0.7)
|
|
|
|
|
- })
|
|
|
|
|
- return () => {
|
|
|
|
|
- window.removeEventListener('resize', () => {})
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // window.addEventListener('resize', () => {
|
|
|
|
|
+ // setClientWidth(document.body.clientWidth * 0.7)
|
|
|
|
|
+ // })
|
|
|
|
|
+ // return () => {
|
|
|
|
|
+ // window.removeEventListener('resize', () => {})
|
|
|
|
|
+ // }
|
|
|
}, [])
|
|
}, [])
|
|
|
|
|
|
|
|
return (
|
|
return (
|
|
|
<Fragment>
|
|
<Fragment>
|
|
|
- <Drawer visible={visible} {...resetProps} width={clientWidth} getContainer={false}>
|
|
|
|
|
|
|
+ <Drawer
|
|
|
|
|
+ className="my-drawer"
|
|
|
|
|
+ visible={visible}
|
|
|
|
|
+ {...resetProps}
|
|
|
|
|
+ // width={clientWidth}
|
|
|
|
|
+ getContainer={false}>
|
|
|
{children}
|
|
{children}
|
|
|
</Drawer>
|
|
</Drawer>
|
|
|
</Fragment>
|
|
</Fragment>
|