怎樣設(shè)計(jì)靜態(tài)網(wǎng)站頁(yè)面谷歌官方app下載
如果是單選那么全新的按鈕應(yīng)該隱藏或者不可編輯的狀態(tài)。但是我沒(méi)找到改變成不可編輯的方法,只能采取隱藏
<template><!-- 注意要包一層div根元素,否則css樣式可能會(huì)不生效,原因不詳 --><div><el-table ref="proTable" class="table_wrapper":data="tableData" @select="selectClick"><el-table-column type="selection" width="55" /><el-table-column prop="name" label="名稱(chēng)" /></el-table></div> </template><script setup lang='ts'> import { ref, reactive, toRefs } from 'vue' const taskTableRef = ref(); // 表格ref// 變量定義 const state = reactive({tableData: [{name: '啦啦啦'},{name: '嘻嘻嘻'},{name: '哈哈哈'}], });
const selectClick = (selection: any, row: any) => {if (selection.length > 1) {let del_row = selection.shift();proTable.value.toggleRowSelection(del_row, false); // 用于多選表格,切換某一行的選中狀態(tài),如果使用了第二個(gè)參數(shù),則是設(shè)置這一行選中與否(selected 為 true 則選中)}console.log("勾選的是數(shù)組:",selection) }
<style lang="scss">
// 隱藏全選按鈕。注意這里我沒(méi)有加scoped
.table_wrapper th.el-table__cell:nth-child(1) .cell{visibility: hidden;
}
</style>