diff --git a/package/component/src/component/table/index.vue b/package/component/src/component/table/index.vue index a36c2fb2..848d90f5 100644 --- a/package/component/src/component/table/index.vue +++ b/package/component/src/component/table/index.vue @@ -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([...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) => {
import { ref } from 'vue'; -const checkedKeys = ref([]) +const checkedKeys = ref([30,31]) const showCheckbox = ref(true) diff --git a/package/document/src/document/zh-CN/guide/changelog.md b/package/document/src/document/zh-CN/guide/changelog.md index 10d82e91..da3a34ab 100644 --- a/package/document/src/document/zh-CN/guide/changelog.md +++ b/package/document/src/document/zh-CN/guide/changelog.md @@ -14,13 +14,14 @@
  • -

    1.1.8 2022-06-18

    +

    1.1.8 2022-06-19

    • [新增] checkbox 组件 is-indeterminate 属性, 用于展示半选状态
    • [新增] layui-vue-helper 插件, 用于 Visual Studio Code 辅助开发
    • [新增] textarea 组件 show-count 属性, 用于展示输入长度与 max-length
    • [修复] carousel 组件加载时无法获取 carousel-item 轮播项
    • [修复] input-number 组件 modelValue 属性类型错误
    • +
    • [修复] checkbox 组件 夜间模式 选中状态异常