|
@@ -24,7 +24,8 @@
|
|
</template>
|
|
</template>
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
import type { PropType } from 'vue';
|
|
import type { PropType } from 'vue';
|
|
- import { ref } from 'vue';
|
|
|
|
|
|
+ import { ref, defineExpose } from 'vue';
|
|
|
|
+ import { isNil } from 'lodash-es';
|
|
// component
|
|
// component
|
|
import { Skeleton } from 'ant-design-vue';
|
|
import { Skeleton } from 'ant-design-vue';
|
|
import { CollapseTransition } from '/@/components/Transition';
|
|
import { CollapseTransition } from '/@/components/Transition';
|
|
@@ -66,13 +67,17 @@
|
|
/**
|
|
/**
|
|
* @description: Handling development events
|
|
* @description: Handling development events
|
|
*/
|
|
*/
|
|
- function handleExpand() {
|
|
|
|
- show.value = !show.value;
|
|
|
|
|
|
+ function handleExpand(val: boolean) {
|
|
|
|
+ show.value = isNil(val) ? !show.value : val;
|
|
if (props.triggerWindowResize) {
|
|
if (props.triggerWindowResize) {
|
|
// 200 milliseconds here is because the expansion has animation,
|
|
// 200 milliseconds here is because the expansion has animation,
|
|
useTimeoutFn(triggerWindowResize, 200);
|
|
useTimeoutFn(triggerWindowResize, 200);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ defineExpose({
|
|
|
|
+ handleExpand,
|
|
|
|
+ });
|
|
</script>
|
|
</script>
|
|
<style lang="less">
|
|
<style lang="less">
|
|
@prefix-cls: ~'@{namespace}-collapse-container';
|
|
@prefix-cls: ~'@{namespace}-collapse-container';
|