56 lines
1.2 KiB
Vue
56 lines
1.2 KiB
Vue
<template>
|
|
<h1 class="title">
|
|
用户
|
|
</h1>
|
|
<el-row class="row-bg" justify="center">
|
|
<el-col :span="16">
|
|
<el-table :data="tableData" style="width: 100%" stripe :row-class-name="tableRowClassName">
|
|
<el-table-column prop="id" label="Id" width="180" />
|
|
<el-table-column label="User" width="180">
|
|
<template #default="scope">
|
|
<el-link type="primary" :href="'/user/'+scope.row.id">
|
|
{{scope.row.username}}
|
|
</el-link>
|
|
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column prop="affiliation" label="Affiliation" />
|
|
<el-table-column prop="country" label="Country" />
|
|
<el-table-column prop="website" label="Website" />
|
|
|
|
</el-table>
|
|
</el-col>
|
|
</el-row>
|
|
|
|
</template>
|
|
|
|
<script>
|
|
|
|
import axios from "axios";
|
|
|
|
export default {
|
|
data(){
|
|
return{
|
|
tableData:[],
|
|
}
|
|
},
|
|
mounted() {
|
|
axios.get('/api/v1/user/users').then(res => {
|
|
if (res.data.code === 200) {
|
|
console.log(res.data.data);
|
|
this.tableData = res.data.data;
|
|
}
|
|
})
|
|
}
|
|
}
|
|
</script>
|
|
|
|
|
|
<style lang="less" scoped>
|
|
.title{
|
|
display: flex;
|
|
justify-content: center;
|
|
color: #2c3e50;
|
|
}
|
|
</style>
|