mirror of
https://github.com/jeecgboot/JeecgBoot.git
synced 2026-02-04 01:25:34 +08:00
前端和后端源码,合并到一个git仓库中,方便用户下载,避免前后端不匹配的问题
This commit is contained in:
44
jeecgboot-vue3/src/settings/registerThirdComp.ts
Normal file
44
jeecgboot-vue3/src/settings/registerThirdComp.ts
Normal file
@ -0,0 +1,44 @@
|
||||
import type { App } from 'vue';
|
||||
import { registerJVxeTable } from '/@/components/jeecg/JVxeTable';
|
||||
import { registerJVxeCustom } from '/@/components/JVxeCustom';
|
||||
|
||||
// 注册全局dayjs
|
||||
import dayjs from 'dayjs';
|
||||
import relativeTime from 'dayjs/plugin/relativeTime';
|
||||
import customParseFormat from 'dayjs/plugin/customParseFormat';
|
||||
import { createAsyncComponent } from '/@/utils/factory/createAsyncComponent';
|
||||
|
||||
export async function registerThirdComp(app: App) {
|
||||
//---------------------------------------------------------------------
|
||||
// 注册 JVxeTable 组件
|
||||
registerJVxeTable(app);
|
||||
// 注册 JVxeTable 自定义组件
|
||||
await registerJVxeCustom();
|
||||
//---------------------------------------------------------------------
|
||||
// 注册全局聊天表情包
|
||||
// update-begin--author:liaozhiyang---date:20240308---for:【QQYUN-8241】emoji-mart-vue-fast库异步加载
|
||||
app.component(
|
||||
'Picker',
|
||||
createAsyncComponent(() => {
|
||||
return new Promise((resolve, rejected) => {
|
||||
import('emoji-mart-vue-fast/src')
|
||||
.then((res) => {
|
||||
const { Picker } = res;
|
||||
resolve(Picker);
|
||||
})
|
||||
.catch((err) => {
|
||||
rejected(err);
|
||||
});
|
||||
});
|
||||
})
|
||||
);
|
||||
// update-end--author:liaozhiyang---date:20240308---for:【QQYUN-8241】emoji-mart-vue-fast库异步加载
|
||||
//---------------------------------------------------------------------
|
||||
// 注册全局dayjs
|
||||
dayjs.locale('zh-cn');
|
||||
dayjs.extend(relativeTime);
|
||||
dayjs.extend(customParseFormat);
|
||||
app.config.globalProperties.$dayjs = dayjs
|
||||
app.provide('$dayjs', dayjs)
|
||||
//---------------------------------------------------------------------
|
||||
}
|
||||
Reference in New Issue
Block a user