fixs field of BOOL

This commit is contained in:
devezhao 2019-10-24 00:17:21 +08:00
parent c1d1e0ec98
commit 19cf941711

View file

@ -4,7 +4,10 @@
class RbFormBool extends RbFormElement { class RbFormBool extends RbFormElement {
constructor(props) { constructor(props) {
super(props) super(props)
this.state.value = props.value || 'F' if (!props.onView) {
if (props.value === true || props.value === 'true') this.state.value = 'T'
else if (props.value === false || props.value === 'false') this.state.value = 'F'
}
this.changeValue = this.changeValue.bind(this) this.changeValue = this.changeValue.bind(this)
} }
renderElement() { renderElement() {