✨(table): tableCheckedKeys 加入半选状态
更新文档
This commit is contained in:
parent
cb1672b8e1
commit
8926bb6022
@ -54,7 +54,9 @@ const emit = defineEmits([
|
||||
const slot = useSlots();
|
||||
const slots = slot.default && slot.default();
|
||||
|
||||
|
||||
const allChecked = ref(false);
|
||||
const hasChecked = ref(false);
|
||||
const tableDataSource = ref([...props.dataSource]);
|
||||
const tableSelectedKeys = ref<Recordable[]>([...props.selectedKeys]);
|
||||
const tableColumns = ref([...props.columns]);
|
||||
@ -94,9 +96,14 @@ watch(
|
||||
} else {
|
||||
allChecked.value = false;
|
||||
}
|
||||
if (tableSelectedKeys.value.length > 0) {
|
||||
hasChecked.value = true;
|
||||
} else {
|
||||
hasChecked.value = false;
|
||||
}
|
||||
emit("update:selectedKeys", tableSelectedKeys.value);
|
||||
},
|
||||
{ deep: true }
|
||||
{ deep: true, immediate: true }
|
||||
);
|
||||
|
||||
const change = function (page: any) {
|
||||
@ -298,7 +305,8 @@ props.dataSource.map((value: any) => {
|
||||
<th v-if="checkbox" class="layui-table-col-special">
|
||||
<div class="layui-table-cell laytable-cell-checkbox">
|
||||
<lay-checkbox
|
||||
v-model="allChecked"
|
||||
v-model="hasChecked"
|
||||
:is-indeterminate="!allChecked"
|
||||
skin="primary"
|
||||
label="all"
|
||||
@change="changeAll"
|
||||
|
@ -207,7 +207,7 @@ function handleClick(node) {
|
||||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
|
||||
const checkedKeys = ref([])
|
||||
const checkedKeys = ref([30,31])
|
||||
const showCheckbox = ref(true)
|
||||
</script>
|
||||
|
||||
|
@ -14,13 +14,14 @@
|
||||
<ul>
|
||||
<a name="1-1-8"></a>
|
||||
<li>
|
||||
<h3>1.1.8 <span class="layui-badge-rim">2022-06-18</span></h3>
|
||||
<h3>1.1.8 <span class="layui-badge-rim">2022-06-19</span></h3>
|
||||
<ul>
|
||||
<li>[新增] checkbox 组件 is-indeterminate 属性, 用于展示半选状态</li>
|
||||
<li>[新增] layui-vue-helper 插件, 用于 Visual Studio Code 辅助开发</li>
|
||||
<li>[新增] textarea 组件 show-count 属性, 用于展示输入长度与 max-length</li>
|
||||
<li>[修复] carousel 组件加载时无法获取 carousel-item 轮播项</li>
|
||||
<li>[修复] input-number 组件 modelValue 属性类型错误</li>
|
||||
<li>[修复] checkbox 组件 夜间模式 选中状态异常</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
Loading…
Reference in New Issue
Block a user