| | |
| | | let btn = cards.action[index] |
| | | btn.eleType = 'button' |
| | | |
| | | if (!btn.width) { |
| | | btn.width = 12 |
| | | } |
| | | if (btn.color) { |
| | | btn.style = btn.style || {} |
| | | btn.style.color = '#ffffff' |
| | | if (btn.color === 'primary') { |
| | | btn.style.backgroundColor = '#1677ff' |
| | | } else if (btn.color === 'danger') { |
| | | btn.style.backgroundColor = '#ff3141' |
| | | } else if (btn.color === 'warning') { |
| | | btn.style.backgroundColor = '#ff8f1f' |
| | | } else if (btn.color === 'success') { |
| | | btn.style.backgroundColor = '#00b578' |
| | | } else if (btn.color === 'light') { |
| | | btn.style.backgroundColor = '#cccccc' |
| | | } |
| | | } |
| | | |
| | | let _elements = [...this.state.elements, btn] |
| | | |
| | | this.setState({ |