constructor()

in src/ui/widget/Collapsible.tsx [39:58]


	constructor(p: Prop){
		super(p);

		// 这段根据props创造一个初始的state
		let st = Collapsible.genNextState(this, this.props.open, false);
		if(!this.props.open){ // 初始折叠的话,不能占用空间,又有实际大小供componentDidMount读取。
			st.css.position = "absolute"
			st.css.display = this.props.style.display;
			delete st.css.maxHeight;
		}
		st.self = this;
		this.state = st;

		this.closeStyle = {};
		for(let k of Object.keys(this.props.style)){
			if(k.indexOf("margin") != 0){
				this.closeStyle[k] = this.props.style[k];
			}
		}
	}