提交 14ba72dd 编写于 作者: V vben

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

上级 be0d3539
/**
* 任意类型的函数
*/
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,
};
......@@ -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
......
......@@ -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',
......
......@@ -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)) {
......
......@@ -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';
......
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';
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册