Merge pull request #201 from yuhengshen/main

fix: tabs-view 宽度计算错误
This commit is contained in:
Ah jung
2022-12-07 09:06:35 +08:00
committed by GitHub
2 changed files with 5 additions and 6 deletions

View File

@@ -1,6 +1,6 @@
<template> <template>
<div <div
class="tabs-view" class="tabs-view box-border"
:class="{ :class="{
'tabs-view-fix': multiTabsSetting.fixed, 'tabs-view-fix': multiTabsSetting.fixed,
'tabs-view-fixed-header': isMultiHeaderFixed, 'tabs-view-fixed-header': isMultiHeaderFixed,
@@ -642,7 +642,6 @@
background: var(--color); background: var(--color);
border-radius: 2px; border-radius: 2px;
cursor: pointer; cursor: pointer;
//margin-right: 10px;
&-btn { &-btn {
color: var(--color); color: var(--color);
@@ -665,7 +664,7 @@
.tabs-view-fix { .tabs-view-fix {
position: fixed; position: fixed;
z-index: 5; z-index: 5;
padding: 6px 19px 6px 10px; padding: 6px 10px 6px 10px;
left: 200px; left: 200px;
} }

View File

@@ -1,5 +1,5 @@
import { h, unref } from 'vue'; import { h, unref } from 'vue';
import type { App, Plugin } from 'vue'; import type { App, Plugin, Component } from 'vue';
import { NIcon, NTag } from 'naive-ui'; import { NIcon, NTag } from 'naive-ui';
import { PageEnum } from '@/enums/pageEnum'; import { PageEnum } from '@/enums/pageEnum';
import { isObject } from './is/index'; import { isObject } from './is/index';
@@ -144,7 +144,7 @@ export function filterRouter(routerMap: Array<any>) {
}); });
} }
export const withInstall = <T>(component: T, alias?: string) => { export const withInstall = <T extends Component>(component: T, alias?: string) => {
const comp = component as any; const comp = component as any;
comp.install = (app: App) => { comp.install = (app: App) => {
app.component(comp.name || comp.displayName, component); app.component(comp.name || comp.displayName, component);
@@ -187,7 +187,7 @@ export function getTreeAll(data: any[]): any[] {
} }
// dynamic use hook props // dynamic use hook props
export function getDynamicProps<T, U>(props: T): Partial<U> { export function getDynamicProps<T extends {}, U>(props: T): Partial<U> {
const ret: Recordable = {}; const ret: Recordable = {};
Object.keys(props).map((key) => { Object.keys(props).map((key) => {