44 lines
931 B
JavaScript
44 lines
931 B
JavaScript
import React from 'react';
|
|
import { WeaSlideModal } from 'ecCom';
|
|
import { Button } from 'antd';
|
|
|
|
|
|
export default class SidePage extends React.Component {
|
|
constructor(props) {
|
|
super(props);
|
|
this.state = {
|
|
visible: false,
|
|
data:{}
|
|
}
|
|
}
|
|
|
|
componentDidMount() {
|
|
this.props.onRef(this)
|
|
}
|
|
|
|
componentDidUpdate(prevProps, prevState) {
|
|
if (prevProps.data !== this.props.data) {
|
|
}
|
|
}
|
|
|
|
openSide = (data) => {
|
|
this.setState({ visible: true,
|
|
data:data})
|
|
}
|
|
|
|
render() {
|
|
const { visible,data } = this.state;
|
|
return (
|
|
<WeaSlideModal visible={visible}
|
|
top={20}
|
|
width={30}
|
|
height={70}
|
|
direction={'right'}
|
|
measure={'%'}
|
|
title={'详细信息'}
|
|
content={(<div>{JSON.stringify(data)}</div>)}
|
|
onClose={() => this.setState({ visible: false })}
|
|
onAnimationEnd={() => console.log('onAnimationEnd')} />
|
|
)
|
|
}
|
|
} |