初始化
This commit is contained in:
10
src/core/common/naive-ui/components.ts
Normal file
10
src/core/common/naive-ui/components.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import {
|
||||
create,
|
||||
NButton,
|
||||
NCard,
|
||||
NConfigProvider,
|
||||
} from 'naive-ui'
|
||||
|
||||
export const naiveUi = create({
|
||||
components: [NButton, NCard, NConfigProvider]
|
||||
})
|
||||
21
src/core/common/naive-ui/discrete-api.ts
Normal file
21
src/core/common/naive-ui/discrete-api.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { createDiscreteApi } from 'naive-ui'
|
||||
import { configProviderProps } from './theme.ts'
|
||||
|
||||
const { message, notification, dialog, loadingBar, modal } = createDiscreteApi(
|
||||
['message', 'dialog', 'notification', 'loadingBar', 'modal'],
|
||||
{
|
||||
configProviderProps: configProviderProps,
|
||||
notificationProviderProps: {
|
||||
placement: 'bottom-right',
|
||||
max: 3
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
export const { messageApi, notificationApi, dialogApi, loadingBarApi, modalApi } = {
|
||||
messageApi: message,
|
||||
notificationApi: notification,
|
||||
dialogApi: dialog,
|
||||
loadingBarApi: loadingBar,
|
||||
modalApi: modal
|
||||
}
|
||||
15
src/core/common/naive-ui/theme.ts
Normal file
15
src/core/common/naive-ui/theme.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { type ConfigProviderProps, darkTheme, dateZhCN, type GlobalTheme, lightTheme, zhCN } from 'naive-ui'
|
||||
|
||||
const lTheme: GlobalTheme = {
|
||||
...lightTheme,
|
||||
common: {
|
||||
...lightTheme.common,
|
||||
primaryColor: '#0070f3'
|
||||
}
|
||||
}
|
||||
|
||||
export const configProviderProps: ConfigProviderProps = {
|
||||
theme: lTheme,
|
||||
dateLocale: dateZhCN,
|
||||
locale: zhCN,
|
||||
}
|
||||
29
src/core/common/types/Version.ts
Normal file
29
src/core/common/types/Version.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* 版本信息
|
||||
*/
|
||||
export interface Version {
|
||||
/**
|
||||
* 公司名称
|
||||
*/
|
||||
company: string
|
||||
|
||||
/**
|
||||
* 版本号
|
||||
*/
|
||||
major: number
|
||||
|
||||
/**
|
||||
* 子版本号
|
||||
*/
|
||||
minor: number
|
||||
|
||||
/**
|
||||
* 修订号
|
||||
*/
|
||||
build: number
|
||||
|
||||
/**
|
||||
* 私有版本号
|
||||
*/
|
||||
private: number
|
||||
}
|
||||
Reference in New Issue
Block a user