Добавлен сервис уведомлений
This commit is contained in:
22
resources/js/Plugins/naiveUI.js
Normal file
22
resources/js/Plugins/naiveUI.js
Normal file
@@ -0,0 +1,22 @@
|
||||
import {createDiscreteApi, darkTheme, lightTheme} from "naive-ui";
|
||||
|
||||
export function setupNaiveDiscreteApi(app) {
|
||||
const {message, notification, dialog, loadingBar} = createDiscreteApi(
|
||||
['message', 'dialog', 'notification', 'loadingBar'],
|
||||
{
|
||||
configProviderProps: {
|
||||
theme: window.matchMedia('(prefers-color-scheme: dark)').matches ? darkTheme : lightTheme
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
window.$notification = notification
|
||||
window.$message = message
|
||||
window.$dialog = dialog
|
||||
window.$loadingBar = loadingBar
|
||||
|
||||
app.config.globalProperties.$notification = notification
|
||||
app.config.globalProperties.$message = message
|
||||
app.config.globalProperties.$dialog = dialog
|
||||
app.config.globalProperties.$loadingBar = loadingBar
|
||||
}
|
||||
Reference in New Issue
Block a user