gaoluyang
3 天以前 92230c9a97dc9ce9df3313d11d26999c04bb6b26
src/plugins/index.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,32 @@
import Tab from './tab'
import Auth from './auth'
import Modal from './modal'
import Bus from './bus';
import Socket from './socketclient'
import { App } from 'vue';
export const tab = Tab;
export const auth = Auth;
export const modal = Modal;
export const bus = Bus
export const socket = Socket
/**
 * åœ¨ç»„合式API中可以通过 import { tab, auth, modal } form '@/plugins' æ¥ä½¿ç”¨tab、auth、modal
 * åœ¨é€‰é¡¹å¼API中可以通过 this.$tab  this.$auth  this.$modal æ¥ä½¿ç”¨tab、auth、modal
 */
export default {
  install(app: App): void {
    // é¡µé¢æ“ä½œ
    app.config.globalProperties.$tab = tab
    // è®¤è¯å¯¹è±¡
    app.config.globalProperties.$auth = auth
    // æ¨¡æ€æ¡†å¯¹è±¡
    app.config.globalProperties.$modal = modal
    // å…¨å±€äº‹ä»¶æ€»çº¿
    app.config.globalProperties.$bus = bus
    // socket对象
    app.config.globalProperties.$socket = socket
  }
}