This commit is contained in:
caishi 2021-09-30 15:59:54 +08:00
parent 20c0f76043
commit 11053da351
2 changed files with 17 additions and 4 deletions

View File

@ -189,13 +189,13 @@
flex-wrap: wrap;
padding-bottom: 2px;
a{
margin: 0px 17px 0px 0px;
margin: 0px 17px 10px 0px;
img{
border-radius: 50%;
width: 40px;
height: 40px;
}
&:nth-child(6){
&:nth-child(5){
margin-right: 0px;
}
}

View File

@ -6,20 +6,29 @@ import { Link } from 'react-router-dom';
import { truncateCommitId } from '../../common/util';
import './Index.scss';
import Tree from '../img/tree.png'
import Pagination from 'rc-pagination';
const limit = 15;
function Tags(props) {
const [ source , setSource ] = useState([]);
const [ source , setSource ] = useState([]);
const [ total ,setTotal ] = useState(0);
const [ page , setPage ] = useState(1);
const { projectsId , owner } = props.match.params;
useEffect(() => {
if (projectsId) {
const url = `/${owner}/${projectsId}/tags.json`;
axios.get(url).then((result) => {
axios.get(url,{
// params:{
// limit
// }
}).then((result) => {
if (result) {
setSource(result.data);
setTotal(result.data.total_count);
}
}).catch(error => {})
}
@ -97,6 +106,10 @@ function Tags(props) {
<div>
<SubMenu tab={"tags"} projectsId={projectsId} owner={owner}/>
<Table className="tagTable" dataSource={source} columns={columns} pagination={false}></Table>
{
total > limit &&
<Pagination current={page} pageSize={limit} onChange={(p)=>setPage(p)}/>
}
</div>
)
}