mirror of
https://github.com/vbenjs/gf-vben-admin.git
synced 2025-01-23 20:00:19 +08:00
refactor: 支持外部调用展开关闭接口
This commit is contained in:
parent
5fc28f92d5
commit
28078d4263
@ -24,7 +24,8 @@
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import type { PropType } from 'vue';
|
||||
import { ref } from 'vue';
|
||||
import { ref, defineExpose } from 'vue';
|
||||
import { isNil } from 'lodash-es';
|
||||
// component
|
||||
import { Skeleton } from 'ant-design-vue';
|
||||
import { CollapseTransition } from '/@/components/Transition';
|
||||
@ -66,13 +67,17 @@
|
||||
/**
|
||||
* @description: Handling development events
|
||||
*/
|
||||
function handleExpand() {
|
||||
show.value = !show.value;
|
||||
function handleExpand(val: boolean) {
|
||||
show.value = isNil(val) ? !show.value : val;
|
||||
if (props.triggerWindowResize) {
|
||||
// 200 milliseconds here is because the expansion has animation,
|
||||
useTimeoutFn(triggerWindowResize, 200);
|
||||
}
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
handleExpand,
|
||||
});
|
||||
</script>
|
||||
<style lang="less">
|
||||
@prefix-cls: ~'@{namespace}-collapse-container';
|
||||
|
Loading…
Reference in New Issue
Block a user