4 changed files with 65 additions and 1 deletions
@ -0,0 +1,60 @@ |
|||
<template> |
|||
<div class="user-edit"> |
|||
<a-table |
|||
class="ant-table-striped" |
|||
size="middle" |
|||
:columns="columns" |
|||
:data-source="data" |
|||
:rowClassName="(record:any, index:number) => (index % 2 === 1 ? 'table-striped' : null)" |
|||
/> |
|||
</div> |
|||
</template> |
|||
|
|||
<script setup lang='ts'> |
|||
const columns = [ |
|||
{ title: '序号', dataIndex: 'key' }, |
|||
{ title: '登录名', dataIndex: 'name' }, |
|||
{ title: '密码', dataIndex: 'password' }, |
|||
{ title: '用户类型', dataIndex: 'address' }, |
|||
{ title: '是否启用', dataIndex: 'address' }, |
|||
{ title: '备注', dataIndex: 'address' }, |
|||
]; |
|||
const data = [ |
|||
{ |
|||
key: '1', |
|||
name: 'John Brown', |
|||
password: 32, |
|||
address: 'New York No. 1 Lake Park', |
|||
}, |
|||
{ |
|||
key: '2', |
|||
name: 'Jim Green', |
|||
password: 42, |
|||
address: 'London No. 1 Lake Park', |
|||
}, |
|||
{ |
|||
key: '3', |
|||
name: 'Joe Black', |
|||
password: 32, |
|||
address: 'Sidney No. 1 Lake Park', |
|||
}, |
|||
{ |
|||
key: '4', |
|||
name: 'Ben Kang', |
|||
password: 15, |
|||
address: 'Sidney No. 1 Lake Park', |
|||
}, |
|||
]; |
|||
</script> |
|||
|
|||
<style scoped lang='less'> |
|||
.user-edit{ |
|||
padding: 20px; |
|||
} |
|||
.ant-table-striped :deep(.table-striped) td { |
|||
background-color: #fafafa; |
|||
} |
|||
:deep(.ant-table-cell){ |
|||
color: #000 !important; |
|||
} |
|||
</style> |
Loading…
Reference in new issue