A modern vue admin. It is based on Vue3, vite and TypeScript. It's fast!
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

34 lines
835 B

import type { App } from 'vue';
import { Button } from './Button';
import { Input, Layout, Radio, Tag, Select, Tooltip, Tree } from 'ant-design-vue';
import VXETable from 'vxe-table';
import { i18n } from '@/locales/setupI18n';
export function registerGlobComp(app: App) {
VXETable.setup({
// @ts-ignore
i18n: (key, args) => {
// @ts-ignore
return i18n.global.t(key, args);
},
translate(key: string, args?: any): string {
if (key.startsWith('{') && key.endsWith('}')) {
const i18nKey = key.replace('{', '').replace('}', '');
// @ts-ignore
return i18n.global.t(i18nKey, args);
}
return key;
},
});
app
.use(Input)
.use(Button)
.use(Layout)
.use(Radio)
.use(Tag)
.use(Select)
.use(Tooltip)
.use(Tree)
.use(VXETable);
}