Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
fix: typo
Browse files Browse the repository at this point in the history
  • Loading branch information
likui628 committed Dec 23, 2023
1 parent 23391c7 commit 3279bf6
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 26 deletions.
25 changes: 13 additions & 12 deletions apps/admin/src/layout/components/app/AppProvider.tsx
Original file line number Diff line number Diff line change
@@ -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)

Expand All @@ -26,21 +26,21 @@ 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
}
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
Expand Down Expand Up @@ -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,
Expand Down
25 changes: 13 additions & 12 deletions apps/gf-vben/src/layout/components/app/AppProvider.tsx
Original file line number Diff line number Diff line change
@@ -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)

Expand All @@ -25,20 +25,20 @@ 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
}
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
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion packages/request/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ export {
createAxios,
initRequest,
setMsg,
setNoice,
setNotice,
setDialog,
} from './src/index'
2 changes: 1 addition & 1 deletion packages/request/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ export let context: ContextOptions = {
export const setMsg = (func: AnyFunction<any>) => {
context.msgFunction = func
}
export const setNoice = (func: AnyFunction<any>) => {
export const setNotice = (func: AnyFunction<any>) => {
context.noticeFunction = func
}
export const setDialog = (func: AnyFunction<any>) => {
Expand Down

0 comments on commit 3279bf6

Please sign in to comment.