import React from 'react' ; import './styles/index.scss' ; interface Props { size ? : string ; position ? : string ; } export default function ( { size = 'sm' , position = 'center' } ) { return < span styleName = "loading" > < /span>; let sizeList = { sm : 'spinner-border-sm' } ; let positionList = { center : 'd-flex justify-content-center' , } ; return ( < div className = { `${ positionList [ position ] || '' }` } > < div className = { `spinner-border text-primary ${ sizeList [ size ] || '' }` } role = "status" > < span className = "sr-only" > 加载中 ... < /span> < /div> < /div>); }