Commit 0a462242 authored by afc163's avatar afc163

Fix FooterToolbar width

parent 5acd5e7a
......@@ -11,7 +11,6 @@
background: #fff;
border-top: 1px solid @border-color-split;
padding: 0 24px;
transition: all .3s;
z-index: 9;
&:after {
......
......@@ -42,6 +42,22 @@ const tableData = [{
}];
class AdvancedForm extends PureComponent {
state = {
width: '100%',
};
componentDidMount() {
window.addEventListener('resize', this.resizeFooterToolbar);
}
componentWillUnmount() {
window.removeEventListener('resize', this.resizeFooterToolbar);
}
resizeFooterToolbar = () => {
const sider = document.querySelectorAll('.ant-layout-sider')[0];
const width = `calc(100% - ${sider.style.width})`;
if (this.state.width !== width) {
this.setState({ width });
}
}
render() {
const { form, dispatch, submitting } = this.props;
const { getFieldDecorator, validateFieldsAndScroll, getFieldsError } = form;
......@@ -257,7 +273,7 @@ class AdvancedForm extends PureComponent {
initialValue: tableData,
})(<TableForm />)}
</Card>
<FooterToolbar>
<FooterToolbar style={{ width: this.state.width }}>
{getErrorInfo()}
<Button type="primary" onClick={validate} loading={submitting}>
提亀
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment