Browse Source

fix: 树样式调整

deploy-dev
xuziqiang 4 months ago
parent
commit
1c709d3ccf
  1. 40
      lib/component/tree/tree-api.vue

40
lib/component/tree/tree-api.vue

@ -1,22 +1,24 @@
<template>
<a-spin :spinning="treeState.loading">
<div class="ns-tree-form">
<div v-if="header" class="ns-tree-title">
<ns-icon :name="header.icon" size="14" />
<span>{{ header.title }}</span>
<div class="ns-tree-container">
<div class="ns-tree-form">
<div v-if="header" class="ns-tree-title">
<ns-icon :name="header.icon" size="14" />
<span>{{ header.title }}</span>
</div>
<div v-if="!formConfig?.schema">
<ns-form ref="formElRef" v-bind="formConfig" :model="formModel" @finish="formFinish" />
</div>
</div>
<div v-if="!formConfig?.schema">
<ns-form ref="formElRef" v-bind="formConfig" :model="formModel" @finish="formFinish" />
</div>
</div>
<div style="min-height: 150px; overflow-y: scroll">
<ns-tree v-if="treeData?.length" v-bind="getBindValue" v-model:selectedKeys="selectedKeys">
<template #[item]="data" v-for="(item, index) in Object.keys($slots)" :key="index">
<slot :name="item" v-bind="{ ...data, formModel } || {}"></slot>
</template>
</ns-tree>
<!-- <a-empty v-if="!treeData?.length" /> -->
<div style="min-height: 150px">
<ns-tree v-if="treeData?.length" v-bind="getBindValue" v-model:selectedKeys="selectedKeys">
<template #[item]="data" v-for="(item, index) in Object.keys($slots)" :key="index">
<slot :name="item" v-bind="{ ...data, formModel } || {}"></slot>
</template>
</ns-tree>
<!-- <a-empty v-if="!treeData?.length" /> -->
</div>
</div>
</a-spin>
</template>
@ -150,4 +152,12 @@
width: 100%;
}
}
.ns-tree-container {
display: flex;
flex-direction: column;
&:last-child {
flex: 1;
}
}
</style>

Loading…
Cancel
Save