展示列设置改变后表中数据刷新
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ref, defineProps, defineEmits,onMounted,onUnmounted } from 'vue';
|
||||
import { ref, defineProps, defineEmits,onMounted,onUnmounted,watch } from 'vue';
|
||||
|
||||
|
||||
const props = defineProps({
|
||||
@@ -34,8 +34,17 @@ const props = defineProps({
|
||||
},
|
||||
});
|
||||
|
||||
// 监听 columns 的变化,当 visible 属性改变时触发 updateTableKey
|
||||
watch(
|
||||
() => props.columns,
|
||||
(newColumns) => {
|
||||
emits('updateTableKey');
|
||||
},
|
||||
{ deep: true } // 深度监听,以便检测到对象内部属性的变化
|
||||
);
|
||||
|
||||
// 定义 emit,用于更新 showColumnList
|
||||
const emits = defineEmits(['update:show-column-list','setDefult']);
|
||||
const emits = defineEmits(['update:show-column-list','setDefult','updateTableKey']);
|
||||
|
||||
// 切换多选列表的显示
|
||||
const toggleColumnList = () => {
|
||||
|
||||
Reference in New Issue
Block a user