Browse Source

fix: 树样式调整

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

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

@ -1,5 +1,6 @@
<template> <template>
<a-spin :spinning="treeState.loading"> <a-spin :spinning="treeState.loading">
<div class="ns-tree-container">
<div class="ns-tree-form"> <div class="ns-tree-form">
<div v-if="header" class="ns-tree-title"> <div v-if="header" class="ns-tree-title">
<ns-icon :name="header.icon" size="14" /> <ns-icon :name="header.icon" size="14" />
@ -10,7 +11,7 @@
</div> </div>
</div> </div>
<div style="min-height: 150px; overflow-y: scroll"> <div style="min-height: 150px">
<ns-tree v-if="treeData?.length" v-bind="getBindValue" v-model:selectedKeys="selectedKeys"> <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"> <template #[item]="data" v-for="(item, index) in Object.keys($slots)" :key="index">
<slot :name="item" v-bind="{ ...data, formModel } || {}"></slot> <slot :name="item" v-bind="{ ...data, formModel } || {}"></slot>
@ -18,6 +19,7 @@
</ns-tree> </ns-tree>
<!-- <a-empty v-if="!treeData?.length" /> --> <!-- <a-empty v-if="!treeData?.length" /> -->
</div> </div>
</div>
</a-spin> </a-spin>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
@ -150,4 +152,12 @@
width: 100%; width: 100%;
} }
} }
.ns-tree-container {
display: flex;
flex-direction: column;
&:last-child {
flex: 1;
}
}
</style> </style>

Loading…
Cancel
Save