index.ts 783 B

12345678910111213141516171819202122232425262728
  1. import Tab from './tab'
  2. import Auth from './auth'
  3. import Modal from './modal'
  4. import Bus from './bus';
  5. import Socket from './socket'
  6. import { App } from 'vue';
  7. export const tab = Tab;
  8. export const auth = Auth;
  9. export const modal = Modal;
  10. export const bus = Bus
  11. export const socket = Socket
  12. /**
  13. * 在组合式API中可以通过 import { tab, auth, modal } form '@/plugins' 来使用tab、auth、modal
  14. * 在选项式API中可以通过 this.$tab this.$auth this.$modal 来使用tab、auth、modal
  15. */
  16. export default {
  17. install(app: App): void {
  18. app.config.globalProperties.$tab = tab
  19. app.config.globalProperties.$auth = auth
  20. app.config.globalProperties.$modal = modal
  21. app.config.globalProperties.$bus = bus
  22. app.config.globalProperties.$socket = socket
  23. }
  24. }