Skip to content

Commit

Permalink
fix: 🐛column 更新展示内容后宽度重新计算
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyjone committed May 22, 2023
1 parent bf7da07 commit b6f9daa
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/components/column/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,15 @@
<script lang="ts">
import Variables from '@/constants/vars';
import columnProps from './props';
import { defineComponent, useSlots, computed, ref, onMounted } from 'vue';
import {
defineComponent,
useSlots,
computed,
ref,
onMounted,
watch,
nextTick
} from 'vue';
import useStyle from '@/composables/useStyle';
import useSlotsBox from '@/composables/useSlotsBox';
import SelectionVue from './selection.vue';
Expand Down Expand Up @@ -87,6 +95,14 @@ const prefixWidth = ref(0);
onMounted(() => {
prefixWidth.value = selectionRef.value?.clientWidth ?? 0;
});
watch(
() => [$styleBox.showCheckbox, $styleBox.showExpand],
async () => {
await nextTick();
prefixWidth.value = selectionRef.value?.clientWidth ?? 0;
}
);
</script>
<style lang="scss">
Expand Down

0 comments on commit b6f9daa

Please sign in to comment.