赞
踩
- <template>
- <el-table v-el-table-infinite-scroll="load" :data="data" :infinite-scroll-disabled="disabled" height="530px">
- <el-table-column type="deviceName" />
- <el-table-column prop="userRealName" label="date" />
- <el-table-column prop="deviceCode" label="name" />
- </el-table>
- </template>
-
- <script>
- export default {
- directives: {
- "infinite-scroll": InfiniteScroll,
- },
- data() {
- return {
- data: [],
- total: 5,
- disabled: false,
- par: {
- recordId: '',
- firstIndex: '1', //第几页
- pageSize: '10' //一页有多少数据
- },
- };
- },
- mounted() {
- this.listEquipment()
-
- },
- methods: {
- load() {
- if (!this.disabled) {
- this.par.firstIndex++
- if (this.data.length <= this.total) {
- this.listEquipment()
- } else {
- this.disabled = true
- }
- } else {
- return
- }
- },
- async listEquipment() {
- try {
- let {
- data: res
- } = await this.$http.get('接口', this.par)
- console.log("设备列表", res);
- this.data = this.data.concat(res.data.list)
- this.total = res.data.count //总数据个数
-
- console.log("this.par.firstIndex", this.par.firstIndex);
- } catch (err) {
- console.log(err);
- }
- },
- },
- };
- </script>

Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。