update 用户菜单重做
This commit is contained in:
@@ -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 <></>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user