cjd-parkball
Version:
> 中后台业务组件库,中后台就像公园,进入需要买门票(登录),所以以 Parkball(公园球) 命名,公园内必定捕获!作为一个组件库,提供使用方法文档,方便开发者的调用
29 lines (26 loc) • 829 B
JavaScript
import React from 'react'
import classnames from 'classnames'
import renderMore from '../common/render-more'
import { Popover } from '../..'
const tipContent = (items = []) => {
const popOverItems = typeof items === 'string' ? [items] : items
return (
<div className="pk-table-more-item-menu">
<ul style={{ listStyle: 'none', padding: 0 }}>
{
popOverItems.map(item => <li key={item} style={{ margin: '5px 0' }}>{item}</li>)
}
</ul>
<div style={{ textAlign: 'right' }}>
共{items.length}项
</div>
</div>
)
}
export default (items, width = 100) => {
return (<Popover placement="right" content={tipContent([].concat(items))}>
<div className={classnames('pk-table-more-item')} style={{ width }}>
{renderMore(items, 5)}
</div>
</Popover>)
}