fix: tabs style error

This commit is contained in:
chansee97 2024-05-28 21:42:59 +08:00
parent 5f7c77d9c6
commit 2fc1dd4467
4 changed files with 12 additions and 7 deletions

View File

@ -107,7 +107,7 @@ function onClickoutside() {
<n-tabs <n-tabs
type="card" type="card"
size="small" size="small"
:tabs-padding="15" :tabs-padding="10"
:value="tabStore.currentTabPath" :value="tabStore.currentTabPath"
@close="handleClose" @close="handleClose"
> >
@ -125,7 +125,7 @@ function onClickoutside() {
v-for="item in tabStore.tabs" v-for="item in tabStore.tabs"
:key="item.path" :key="item.path"
closable closable
:name="item.path as string" :name="item.path"
@click="handleTab(item)" @click="handleTab(item)"
@contextmenu="handleContextMenu($event, item)" @contextmenu="handleContextMenu($event, item)"
> >
@ -150,5 +150,3 @@ function onClickoutside() {
/> />
</div> </div>
</template> </template>
<style scoped></style>./DropTabs.vue

View File

@ -1,3 +1,8 @@
.n-modal-mask { .n-modal-mask {
backdrop-filter: blur(2px); backdrop-filter: blur(2px);
} }
/* 解决tabs组件不贴合下边缘问题 */
.v-x-scroll {
height: 100%;
}

View File

@ -7,7 +7,7 @@ namespace Api {
/** 用户id */ /** 用户id */
id: number id: number
/** 用户角色类型 */ /** 用户角色类型 */
role: RoleType role: Entity.RoleType
/** 访问toekn */ /** 访问toekn */
accessToken: string accessToken: string
/** 刷新toekn */ /** 刷新toekn */

View File

@ -1,4 +1,4 @@
<script setup lang="tsx"> <script setup lang="ts">
import type { DataTableColumns, FormInst } from 'naive-ui' import type { DataTableColumns, FormInst } from 'naive-ui'
import { NButton, NPopconfirm, NSpace, NSwitch, NTag } from 'naive-ui' import { NButton, NPopconfirm, NSpace, NSwitch, NTag } from 'naive-ui'
import TableModal from './components/TableModal.vue' import TableModal from './components/TableModal.vue'
@ -107,6 +107,7 @@ const columns: DataTableColumns<Entity.User> = [
}, },
] ]
const count = ref(0)
const listData = ref<Entity.User[]>([]) const listData = ref<Entity.User[]>([])
function handleUpdateDisabled(value: 0 | 1, id: number) { function handleUpdateDisabled(value: 0 | 1, id: number) {
const index = listData.value.findIndex(item => item.id === id) const index = listData.value.findIndex(item => item.id === id)
@ -118,6 +119,7 @@ async function getUserList() {
startLoading() startLoading()
await fetchUserPage().then((res: any) => { await fetchUserPage().then((res: any) => {
listData.value = res.data.list listData.value = res.data.list
count.value = res.data.count
endLoading() endLoading()
}) })
} }
@ -207,7 +209,7 @@ const treeData = ref([
</NButton> </NButton>
</div> </div>
<n-data-table :columns="columns" :data="listData" :loading="loading" /> <n-data-table :columns="columns" :data="listData" :loading="loading" />
<Pagination :count="100" @change="changePage" /> <Pagination :count="count" @change="changePage" />
<TableModal ref="modalRef" modal-name="用户" /> <TableModal ref="modalRef" modal-name="用户" />
</NSpace> </NSpace>
</n-card> </n-card>