Skip to content

Commit

Permalink
feat: change useMsgbox api
Browse files Browse the repository at this point in the history
  • Loading branch information
cuixiaorui committed Nov 8, 2020
1 parent 26ad5cb commit 2b55fc8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 20 deletions.
18 changes: 7 additions & 11 deletions packages/message-box/index.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
import MessageBox from './src/MessageBox.js'
import MessageBoxComponent from './src/MessageBox.vue'
export function useMsgbox() {
return MessageBox
}

export function useAlert() {
return MessageBox.alert
}
export function useConfirm() {
return MessageBox.confirm
}
export function usePrompt() {
return MessageBox.prompt
export function useMsgbox() {
return {
msgbox: MessageBox,
alert: MessageBox.alert,
confirm: MessageBox.confirm,
prompt: MessageBox.prompt
}
}

export default MessageBoxComponent
10 changes: 1 addition & 9 deletions src/entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,7 @@ import ElLoading, { useLoading } from '../packages/loading'

import { useMessage } from '../packages/message'

import {
useMsgbox,
useAlert,
usePrompt,
useConfirm
} from '../packages/message-box'
import { useMsgbox } from '../packages/message-box'

import { useNotify } from '../packages/notification'
// Navigation
Expand Down Expand Up @@ -273,9 +268,6 @@ export {
useMessage,
useLoading,
useMsgbox,
useAlert,
usePrompt,
useConfirm,
useNotify,
install,
setupGlobalOptions
Expand Down

0 comments on commit 2b55fc8

Please sign in to comment.