CEES-manage/src/settings/registerThirdComp.ts

40 lines
1.5 KiB
TypeScript
Raw Normal View History

2022-06-10 10:44:44 +08:00
import type { App } from 'vue';
import { registerJVxeTable } from '/@/components/jeecg/JVxeTable';
import { registerJVxeCustom } from '/@/components/JVxeCustom';
2021-10-20 14:32:09 +08:00
// 注册全局聊天表情包
import { Picker } from 'emoji-mart-vue-fast/src';
// import { EmojiIndex } from "emoji-mart-vue-fast/src";
// import data from "emoji-mart-vue-fast/data/apple.json";
2022-10-25 11:12:36 +08:00
// 注册全局dayjs
import dayjs from 'dayjs';
import relativeTime from 'dayjs/plugin/relativeTime';
import customParseFormat from 'dayjs/plugin/customParseFormat';
2022-03-10 09:47:29 +08:00
export async function registerThirdComp(app: App) {
// 注册 JVxeTable 组件
2022-06-10 10:44:44 +08:00
registerJVxeTable(app);
2022-03-10 09:47:29 +08:00
// 注册 JVxeTable 自定义组件
2022-06-10 10:44:44 +08:00
await registerJVxeCustom();
//---------------------------------------------------------------------
// 注册全局聊天表情包
app.component('Picker', Picker);
// let myEmojiIndex = new EmojiIndex(data, {
// function() {
// return true;
// },
// exclude:['recent','people','nature','foods','activity','places','objects','symbols','flags']
// });
// app.config.globalProperties.$globalEmojiIndex = myEmojiIndex;
// app.provide('$globalEmojiIndex', myEmojiIndex);
//---------------------------------------------------------------------
// 注册全局dayjs
2022-11-07 19:01:49 +08:00
dayjs.locale('zh-cn');
dayjs.extend(relativeTime);
dayjs.extend(customParseFormat);
app.config.globalProperties.$dayjs = dayjs;
app.provide('$dayjs', dayjs);
//---------------------------------------------------------------------
2021-10-20 14:32:09 +08:00
}