요소 숨기기 테이블 열 드래그, 표시
3638 단어 프런트엔드
import Pagination from '@/components/Pagination'
export default {
data() {
return {
show: [],
multipleSelection: [],
}
},
props: ["tableHead", "tableData", "tableHeadValue", "total", "listQuery"],
components: {Pagination},
created() {
for (let i = 0; i <= this.tableHeadValue.length; i++) {
let item = {label: true};
this.show.push(item);
}
},
methods: {
renderHeader(h) {
let self = this;
let bin3 = document.getElementsByClassName("el-checkbox-group el-table-filter__checkbox-group");
if (bin3.length != 0) {
for (let c = 0; c < bin3.length; c++) {
let btn = bin3[c].getElementsByClassName("el-checkbox__label");
for (let i = 0; i < btn.length; i++) {
let btn1 = btn[i];
btn1.setAttribute("index", i);
btn1.onclick = function (e) {
self.show[this.getAttribute("index")].label = !self.show[this.getAttribute("index")].label;
e.stopPropagation();
};
}
}
}
return h("span", {domProps: {innerHTML: ` `}});
},
formatter(row, column) {
return row.address;
},
getPage(x) {
this.$emit("pageNumber", x);
},
handleSelectionChange(val) {
this.multipleSelection = val;
console.log(val)
}
}
}