QYF-GitLab1
2025-03-03 c2ddf632c8e642813c89e501d402f06c57369a22
src/views/model/children/landerModel.vue
@@ -20,6 +20,7 @@
        border
        style="width: 100%"
        @selection-change="handleSelectionChange"
        class="landerTable"
      >
        <el-table-column type="selection" width="55" />
        <el-table-column prop="index" label="序号" width="70" />
@@ -28,17 +29,37 @@
        <el-table-column prop="address" label="Address" />
      </el-table>
    </div>
    <div class="lander-pagination-block">
      <el-pagination
        v-model:current-page="currentPage"
        :page-size="pageSize"
        :size="size"
        :background="background"
        layout="total, prev, pager, next"
        :total="100"
        @current-change="handleCurrentChange"
      />
    </div>
  </div>
</template>
<script setup lang="ts">
import { ref } from "vue";
import { Plus } from "@element-plus/icons-vue";
import type { TableInstance } from "element-plus";
import type { ComponentSize, TableInstance } from "element-plus";
// 搜索
const input4 = ref("");
// 表格
const multipleTableRef = ref<TableInstance>();
const multipleSelection = ref<any[]>([]);
// 分页
const currentPage = ref(4);
const pageSize = ref(20);
const size = ref<ComponentSize>("default");
const background = ref(true);
const tableData = [
  {
@@ -83,10 +104,15 @@
    name: "Tom",
    address: "No. 189, Grove St, Los Angeles",
  },
];
const handleCurrentChange = (val: number) => {
  console.log(`current page: ${val}`);
};
const handleSelectionChange = (val: []) => {
  console.log(val);
  multipleSelection.value = val;
};
</script>
@@ -94,13 +120,30 @@
<style lang="less" scoped>
.landerBox {
  width: 100%;
  height: 100%;
  .landerTopBox {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    align-items: center;
    height: 50px;
    padding: 0 10px;
    box-sizing: border-box;
  }
  .landerContentBox {
    width: 100%;
    max-height: calc(100% - 120px);
    .landerTable {
      height: 750px;
    }
  }
  .lander-pagination-block {
    height: 60px;
    display: flex;
    justify-content: flex-end;
    padding: 0 20px;
    background-color: #fff;
  }
}
</style>