feat: transition 新增 enable 属性, 用于开启关闭过渡
This commit is contained in:
parent
ce356012ce
commit
7b6854629b
@ -1,8 +1,11 @@
|
|||||||
<template>
|
<template>
|
||||||
<LayCollapseTransition v-if="type === 'collapse'"
|
<template v-if="enable">
|
||||||
><slot></slot
|
<LayCollapseTransition v-if="type === 'collapse'"><slot></slot></LayCollapseTransition>
|
||||||
></LayCollapseTransition>
|
|
||||||
<LayFadeTransition v-if="type === 'fade'"><slot></slot></LayFadeTransition>
|
<LayFadeTransition v-if="type === 'fade'"><slot></slot></LayFadeTransition>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<slot></slot>
|
||||||
|
</template>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
@ -17,9 +20,11 @@ import LayFadeTransition from "./fadeTransition.vue";
|
|||||||
|
|
||||||
export interface LayTransitionProps {
|
export interface LayTransitionProps {
|
||||||
type?: string;
|
type?: string;
|
||||||
|
enable?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
const props = withDefaults(defineProps<LayTransitionProps>(), {
|
const props = withDefaults(defineProps<LayTransitionProps>(), {
|
||||||
type: "collapse",
|
type: "collapse",
|
||||||
|
enable: true
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
Reference in New Issue
Block a user