mirror of
https://github.com/zhigang1992/react.git
synced 2026-02-12 22:29:35 +08:00
20 lines
377 B
TypeScript
20 lines
377 B
TypeScript
import React from 'react'
|
|
|
|
const Ellipsis: React.FC<React.PropsWithChildren<{}>> = ({ children }) => {
|
|
return (
|
|
<span>
|
|
{children}
|
|
<style jsx>{`
|
|
span {
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
min-width: 0;
|
|
}
|
|
`}</style>
|
|
</span>
|
|
)
|
|
}
|
|
|
|
export default React.memo(Ellipsis)
|