diff --git a/apps/admin/src/layout/components/app/AppProvider.tsx b/apps/admin/src/layout/components/app/AppProvider.tsx index a09ff985..a2451e40 100644 --- a/apps/admin/src/layout/components/app/AppProvider.tsx +++ b/apps/admin/src/layout/components/app/AppProvider.tsx @@ -1,22 +1,22 @@ -import {namespace} from '@/setting' -import {defineComponent, toRefs, ref, unref} from 'vue' -import {useConfigStoreWithOut} from '@/store/config' -import {useMsg, useNotice, useDialog} from '@vben/vbencomponents' -import {setMsg, setNoice, setDialog} from '@vben/request' +import { namespace } from '@/setting' +import { defineComponent, toRefs, ref, unref } from 'vue' +import { useConfigStoreWithOut } from '@/store/config' +import { useMsg, useNotice, useDialog } from '@vben/vbencomponents' +import { setMsg, setNotice, setDialog } from '@vben/request' import { createAppProviderContext, createBreakpointListen } from '@vben/hooks' const props = { /** * class style prefix */ - prefixCls: {type: String, default: namespace}, + prefixCls: { type: String, default: namespace }, } export default defineComponent({ name: 'AppProvider', inheritAttrs: false, props, - setup(props, {slots}) { + setup(props, { slots }) { const isMobile = ref(false) const isSetState = ref(false) @@ -26,10 +26,10 @@ export default defineComponent({ const notice = useNotice() const dialog = useDialog() setMsg(msg) - setNoice(notice) + setNotice(notice) setDialog(dialog) // Monitor screen breakpoint information changes - createBreakpointListen(({screenMap, sizeEnum, width}) => { + createBreakpointListen(({ screenMap, sizeEnum, width }) => { const lgWidth = screenMap.get(sizeEnum.LG) if (lgWidth) { isMobile.value = width.value - 1 < lgWidth @@ -37,10 +37,10 @@ export default defineComponent({ handleRestoreState() }) - const {prefixCls} = toRefs(props) + const { prefixCls } = toRefs(props) // Inject variables into the global - createAppProviderContext({prefixCls, isMobile}) + createAppProviderContext({ prefixCls, isMobile }) /** * Used to maintain the state before the window changes @@ -74,7 +74,8 @@ export default defineComponent({ } else { if (unref(isSetState)) { isSetState.value = false - const {menuMode, menuCollapsed, menuType, menuSplit} = configStore.getBeforeMiniInfo + const { menuMode, menuCollapsed, menuType, menuSplit } = + configStore.getBeforeMiniInfo configStore.setProjectConfig({ menuSetting: { type: menuType, diff --git a/apps/gf-vben/src/layout/components/app/AppProvider.tsx b/apps/gf-vben/src/layout/components/app/AppProvider.tsx index 4404a406..7d2a95a3 100644 --- a/apps/gf-vben/src/layout/components/app/AppProvider.tsx +++ b/apps/gf-vben/src/layout/components/app/AppProvider.tsx @@ -1,22 +1,22 @@ -import {namespace} from '@/setting' -import {defineComponent, toRefs, ref, unref} from 'vue' -import {useConfigStoreWithOut} from '@/store/config' -import {useMsg, useNotice} from '@vben/vbencomponents' -import {setMsg, setNoice} from '@vben/request' +import { namespace } from '@/setting' +import { defineComponent, toRefs, ref, unref } from 'vue' +import { useConfigStoreWithOut } from '@/store/config' +import { useMsg, useNotice } from '@vben/vbencomponents' +import { setMsg, setNotice } from '@vben/request' import { createAppProviderContext, createBreakpointListen } from '@vben/hooks' const props = { /** * class style prefix */ - prefixCls: {type: String, default: namespace}, + prefixCls: { type: String, default: namespace }, } export default defineComponent({ name: 'AppProvider', inheritAttrs: false, props, - setup(props, {slots}) { + setup(props, { slots }) { const isMobile = ref(false) const isSetState = ref(false) @@ -25,9 +25,9 @@ export default defineComponent({ const msg = useMsg() const notice = useNotice() setMsg(msg) - setNoice(notice) + setNotice(notice) // Monitor screen breakpoint information changes - createBreakpointListen(({screenMap, sizeEnum, width}) => { + createBreakpointListen(({ screenMap, sizeEnum, width }) => { const lgWidth = screenMap.get(sizeEnum.LG) if (lgWidth) { isMobile.value = width.value - 1 < lgWidth @@ -35,10 +35,10 @@ export default defineComponent({ handleRestoreState() }) - const {prefixCls} = toRefs(props) + const { prefixCls } = toRefs(props) // Inject variables into the global - createAppProviderContext({prefixCls, isMobile}) + createAppProviderContext({ prefixCls, isMobile }) /** * Used to maintain the state before the window changes @@ -72,7 +72,8 @@ export default defineComponent({ } else { if (unref(isSetState)) { isSetState.value = false - const {menuMode, menuCollapsed, menuType, menuSplit} = configStore.getBeforeMiniInfo + const { menuMode, menuCollapsed, menuType, menuSplit } = + configStore.getBeforeMiniInfo configStore.setProjectConfig({ menuSetting: { type: menuType, diff --git a/packages/request/index.ts b/packages/request/index.ts index 21b13ddf..23d7636c 100644 --- a/packages/request/index.ts +++ b/packages/request/index.ts @@ -4,6 +4,6 @@ export { createAxios, initRequest, setMsg, - setNoice, + setNotice, setDialog, } from './src/index' diff --git a/packages/request/src/index.ts b/packages/request/src/index.ts index df64b54a..9cc8a77a 100644 --- a/packages/request/src/index.ts +++ b/packages/request/src/index.ts @@ -306,7 +306,7 @@ export let context: ContextOptions = { export const setMsg = (func: AnyFunction) => { context.msgFunction = func } -export const setNoice = (func: AnyFunction) => { +export const setNotice = (func: AnyFunction) => { context.noticeFunction = func } export const setDialog = (func: AnyFunction) => {