ruoyi-geek-App/src/plugins/index.ts

33 lines
898 B
TypeScript
Raw Normal View History

2023-08-28 14:43:06 +00:00
import Tab from './tab'
import Auth from './auth'
import Modal from './modal'
2023-09-02 15:14:02 +00:00
import Bus from './bus';
2024-01-17 13:10:35 +00:00
import Socket from './socketclient'
2023-08-28 14:43:06 +00:00
import { App } from 'vue';
2023-09-02 15:14:02 +00:00
2023-08-28 14:43:06 +00:00
export const tab = Tab;
export const auth = Auth;
export const modal = Modal;
2023-09-02 15:14:02 +00:00
export const bus = Bus
2023-09-12 17:32:10 +00:00
export const socket = Socket
2023-08-28 14:43:06 +00:00
2023-09-01 03:05:53 +00:00
/**
* API中可以通过 import { tab, auth, modal } form '@/plugins' 使tabauthmodal
* API中可以通过 this.$tab this.$auth this.$modal 使tabauthmodal
*/
2023-08-28 14:43:06 +00:00
export default {
2023-08-28 14:43:21 +00:00
install(app: App): void {
2024-01-22 15:12:31 +00:00
// 页面操作
2023-08-28 14:43:06 +00:00
app.config.globalProperties.$tab = tab
2024-01-22 15:12:31 +00:00
// 认证对象
2023-08-28 14:43:06 +00:00
app.config.globalProperties.$auth = auth
2024-01-22 15:12:31 +00:00
// 模态框对象
2023-08-28 14:43:06 +00:00
app.config.globalProperties.$modal = modal
2024-01-22 15:12:31 +00:00
// 全局事件总线
2023-09-02 15:14:02 +00:00
app.config.globalProperties.$bus = bus
2024-01-22 15:12:31 +00:00
// socket对象
2023-09-12 17:32:10 +00:00
app.config.globalProperties.$socket = socket
2023-08-28 14:43:06 +00:00
}
}