ant-design-vue/components/index.ts

32 lines
962 B
TypeScript
Raw Normal View History

2021-06-26 09:35:40 +08:00
import type { App } from 'vue';
2018-03-21 21:16:11 +08:00
2021-06-23 21:47:53 +08:00
import * as components from './components';
2019-01-12 11:33:27 +08:00
import { default as version } from './version';
2021-06-23 21:47:53 +08:00
export * from './components';
2021-06-23 23:08:16 +08:00
export const install = function (app: App) {
2021-06-23 21:47:53 +08:00
Object.keys(components).forEach(key => {
const component = components[key];
if (component.install) {
app.use(component);
}
2019-01-12 11:33:27 +08:00
});
2021-06-23 21:47:53 +08:00
app.config.globalProperties.$message = components.message;
app.config.globalProperties.$notification = components.notification;
app.config.globalProperties.$info = components.Modal.info;
app.config.globalProperties.$success = components.Modal.success;
app.config.globalProperties.$error = components.Modal.error;
app.config.globalProperties.$warning = components.Modal.warning;
app.config.globalProperties.$confirm = components.Modal.confirm;
app.config.globalProperties.$destroyAll = components.Modal.destroyAll;
2020-10-13 19:14:56 +08:00
return app;
2019-01-12 11:33:27 +08:00
};
2021-06-23 21:47:53 +08:00
export { version };
2018-04-19 16:42:55 +08:00
export default {
version,
install,
2019-01-12 11:33:27 +08:00
};