fix: 主题样式设置无效,close #2685

This commit is contained in:
vben 2023-04-06 22:12:17 +08:00
parent be0d35394c
commit 14ba72dd1c
7 changed files with 28 additions and 11 deletions

View File

@ -125,6 +125,7 @@
"@vben/eslint-config": "workspace:*",
"@vben/stylelint-config": "workspace:*",
"@vben/ts-config": "workspace:*",
"@vben/types": "workspace:*",
"@vben/vite-config": "workspace:*",
"@vue/compiler-sfc": "^3.2.47",
"@vue/test-utils": "^2.3.2",

View File

@ -1,8 +1,3 @@
/**
*
*/
type AnyFunction = AnyNormalFunction | AnyPromiseFunction;
/**
*
*/
@ -13,6 +8,11 @@ type AnyPromiseFunction = (...arg: any) => PromiseLike<any>;
*/
type AnyNormalFunction = (...arg: any) => any;
/**
*
*/
type AnyFunction = AnyNormalFunction | AnyPromiseFunction;
/**
* T | null
*/
@ -35,6 +35,16 @@ type ReadonlyRecordable<T = any> = {
readonly [key: string]: T;
};
/**
* setTimeout
*/
type TimeoutHandle = ReturnType<typeof setTimeout>;
/**
* setInterval
*/
type IntervalHandle = ReturnType<typeof setInterval>;
export {
type AnyFunction,
type AnyPromiseFunction,
@ -43,4 +53,6 @@ export {
type NonNullable,
type Recordable,
type ReadonlyRecordable,
type TimeoutHandle,
type IntervalHandle,
};

View File

@ -176,6 +176,9 @@ importers:
'@vben/ts-config':
specifier: workspace:*
version: link:internal/ts-config
'@vben/types':
specifier: workspace:*
version: link:packages/types
'@vben/vite-config':
specifier: workspace:*
version: link:internal/vite-config

View File

@ -22,7 +22,7 @@
import { useDesign } from '/@/hooks/web/useDesign';
import { propTypes } from '/@/utils/propTypes';
import { createSimpleRootMenuContext } from './useSimpleMenuContext';
import mitt from '/@/utils/mitt';
import { mitt } from '/@/utils/mitt';
export default defineComponent({
name: 'Menu',

View File

@ -56,6 +56,7 @@
</template>
<script lang="ts">
import { type TimeoutHandle, type Recordable } from '@vben/types';
import type { CSSProperties, PropType } from 'vue';
import type { SubMenuProvider } from './types';
import {
@ -77,7 +78,7 @@
import { Icon } from '/@/components/Icon';
import { Popover } from 'ant-design-vue';
import { isBoolean, isObject } from '/@/utils/is';
import mitt from '/@/utils/mitt';
import { mitt } from '/@/utils/mitt';
const DELAY = 200;
export default defineComponent({
@ -267,14 +268,14 @@
rootMenuEmitter.on(
'on-update-opened',
(data: boolean | (string | number)[] | Recordable) => {
(data: boolean | (string | number)[] | Recordable<any>) => {
if (unref(getCollapse)) return;
if (isBoolean(data)) {
state.opened = data;
return;
}
if (isObject(data) && rootProps.accordion) {
const { opend, parent, uidList } = data as Recordable;
const { opend, parent, uidList } = data as Recordable<any>;
if (parent === instance?.parent) {
state.opened = opend;
} else if (!uidList.includes(instance?.uid)) {

View File

@ -2,7 +2,7 @@
* Used to monitor routing changes to change the status of menus and tabs. There is no need to monitor the route, because the route status change is affected by the page rendering time, which will be slow
*/
import mitt from '/@/utils/mitt';
import { mitt } from '/@/utils/mitt';
import type { RouteLocationNormalized } from 'vue-router';
import { getRawRoute } from '/@/utils';

View File

@ -1,7 +1,7 @@
import 'uno.css';
import '@/design/index.less';
import '@/components/VxeTable/src/css/index.scss';
import 'ant-design-vue/dist/antd.css';
import 'ant-design-vue/dist/antd.less';
// Register icon sprite
import 'virtual:svg-icons-register';