fix: collapse 动画警告

This commit is contained in:
就眠儀式 2022-03-24 17:03:45 +08:00
parent 20d5093ba5
commit 2605386fe5
5 changed files with 6 additions and 4 deletions

View File

@ -19,6 +19,7 @@
<li>[新增] switch 组件 onswitch-icon 插槽。</li> <li>[新增] switch 组件 onswitch-icon 插槽。</li>
<li>[新增] switch 组件 unswitch-icon 插槽。</li> <li>[新增] switch 组件 unswitch-icon 插槽。</li>
<li>[新增] transition 组件 type 属性, 默认为 collapse 过渡。</li> <li>[新增] transition 组件 type 属性, 默认为 collapse 过渡。</li>
<li>[新增] transition 组件 enable 属性, 默认为 true 启用动画。</li>
<li>[新增] transition 组件 type 属性 fade 值, 提供淡出淡入效果。</li> <li>[新增] transition 组件 type 属性 fade 值, 提供淡出淡入效果。</li>
<li>[新增] input 组件 allow-clear 属性, 提供输入清空。</li> <li>[新增] input 组件 allow-clear 属性, 提供输入清空。</li>
<li>[新增] input 组件 prefix 插槽, 提供前缀设置。</li> <li>[新增] input 组件 prefix 插槽, 提供前缀设置。</li>

View File

@ -11,11 +11,13 @@ import { withDefaults, provide, ref, watch } from "vue";
export interface LayCollapseProps { export interface LayCollapseProps {
modelValue?: number | string | []; modelValue?: number | string | [];
accordion?: boolean; accordion?: boolean;
isAmin?: boolean;
} }
const props = withDefaults(defineProps<LayCollapseProps>(), { const props = withDefaults(defineProps<LayCollapseProps>(), {
modelValue: () => [], modelValue: () => [],
accordion: false, accordion: false,
isAmin: true
}); });
// //
@ -31,6 +33,7 @@ const activeValues = ref<Array<any>>(([] as any[]).concat(props.modelValue));
provide("layCollapse", { provide("layCollapse", {
accordion: props.accordion, accordion: props.accordion,
isAmin: props.isAmin,
activeValues, activeValues,
emit, emit,
}); });

View File

@ -3,11 +3,9 @@
v-on:before-enter="beforeEnter" v-on:before-enter="beforeEnter"
v-on:enter="enter" v-on:enter="enter"
v-on:after-enter="afterEnter" v-on:after-enter="afterEnter"
v-on:enter-cancelled="enterCancelled"
v-on:before-leave="beforeLeave" v-on:before-leave="beforeLeave"
v-on:leave="leave" v-on:leave="leave"
v-on:after-leave="afterLeave" v-on:after-leave="afterLeave"
v-on:leave-cancelled="leaveCancelled"
> >
<slot></slot> <slot></slot>
</transition> </transition>

View File

@ -25,6 +25,6 @@ export interface LayTransitionProps {
const props = withDefaults(defineProps<LayTransitionProps>(), { const props = withDefaults(defineProps<LayTransitionProps>(), {
type: "collapse", type: "collapse",
enable: true enable: true,
}); });
</script> </script>

View File

@ -136,7 +136,7 @@ function handleTitleClick(node: TreeData) {
</span> </span>
</div> </div>
</div> </div>
<LayTransition :enable="accordion"> <LayTransition>
<div <div
v-if="node.isLeaf.value" v-if="node.isLeaf.value"
class="layui-tree-pack layui-tree-showLine" class="layui-tree-pack layui-tree-showLine"