index.vue
1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<script setup lang="ts">
import { reactive, ref } from "vue";
import { propertyList } from "@/api/tengxi";
import Pagination from "@/components/Pagination/index.vue";
let data = reactive([]);
let loading = ref(false);
let params = reactive({
total: 0,
query: {
page: 1,
pageSize: 10,
},
});
const handlePageChange = (page, size) => {
params.query.page = page;
params.query.pageSize = size;
};
</script>
<template>
<div class="page-container">
<h1>居民列表</h1>
<el-table
:data="data"
style="width: 100%"
border
v-loading="loading"
element-loading-text="拼命加载中"
>
<el-table-column prop="date" label="日期" width="180"> </el-table-column>
<el-table-column prop="name" label="姓名" width="180"> </el-table-column>
<el-table-column prop="address" label="地址"> </el-table-column>
<el-table-column prop="status" label="状态">
<template #default="scope">
{{ scope.row.status }}
</template>
</el-table-column>
<el-table-column label="按钮">
<template #default="scope">
<el-button type="primary">哈哈</el-button>
</template>
</el-table-column>
</el-table>
<Pagination
:total="params.total"
:currentPage="params.query.page"
:pageSize="params.query.pageSize"
@pageChange="handlePageChange"
></Pagination>
</div>
</template>