1 el-table排序一个字段排序,可清除
<script setup>
import { ref, computed } from "vue";
import { ElMessage } from "element-plus";
const tateHeader = ref([
{
label: "类别",
title: "type",
show: true,
sortable: "custom",
},
{ label: "姓名", title: "name", show: true, sortable: "custom" },
{ label: "年龄", title: "age", show: true, sortable: "custom" },
{ label: "位置", title: "where", show: false, sortable: "custom" },
]);
const tableData = ref([
{
type: "证件类型",
name: "4",
age: "3",
where: "san",
},
{
type: "证件号",
name: "4",
age: "3",
where: "si",
},
{
type: "地址",
name: "4",
age: "3",
where: "wu",
},
]);
const reftable = ref(null);
let orderColumn = ref(""); // 所有排序字段
let propColum