update 用户菜单重做

This commit is contained in:
2021-06-23 13:43:48 +08:00
parent bf18f21a24
commit 621e1ec061
7 changed files with 120 additions and 125 deletions

View File

@@ -2,22 +2,29 @@ import React, { Component } from 'react'
import * as Icon from '@ant-design/icons'
export default class AntIcon extends Component {
render() {
const type = (this.props.type || '').toUpperCase()
if (type) {
if (type.indexOf('OUTLINED') >= 0 || type.indexOf('FILLED') >= 0 || type.indexOf('TWOTONE') >= 0) {
if (
type.indexOf('OUTLINED') >= 0 ||
type.indexOf('FILLED') >= 0 ||
type.indexOf('TWOTONE') >= 0
) {
const I = Icon[this.props.type]
return <I {...this.props} />
return I ? <I {...this.props} /> : false
} else {
const t = type.split('-').map(p => {
return p[0] + p.slice(1).toLowerCase()
}).join('') + 'Outlined'
const t =
type
.split('-')
.map(p => {
return p[0] + p.slice(1).toLowerCase()
})
.join('') + 'Outlined'
const I = Icon[t]
return <I {...this.props} />
return I ? <I {...this.props} /> : false
}
}
return <></>
}
}
}