Expose internal function to global for plugins
This commit is contained in:
parent
e355c8df68
commit
87100e9ae7
|
|
@ -68,3 +68,5 @@ Vue.use(_Vue => {
|
||||||
post,
|
post,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
window.bsAjax = { get, post };
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import $ from 'jquery';
|
import $ from 'jquery';
|
||||||
import sweetalert2 from 'sweetalert2';
|
import sweetalert2 from 'sweetalert2';
|
||||||
import 'toastr';
|
import toastr from 'toastr';
|
||||||
import { trans } from './i18n';
|
import { trans } from './i18n';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -77,3 +77,7 @@ export const swal = sweetalert2.mixin({
|
||||||
confirmButtonText: trans('general.confirm'),
|
confirmButtonText: trans('general.confirm'),
|
||||||
cancelButtonText: trans('general.cancel')
|
cancelButtonText: trans('general.cancel')
|
||||||
});
|
});
|
||||||
|
|
||||||
|
window.toastr = toastr;
|
||||||
|
window.showModal = showModal;
|
||||||
|
window.swal = swal;
|
||||||
|
|
|
||||||
4
resources/assets/src/shims.d.ts
vendored
4
resources/assets/src/shims.d.ts
vendored
|
|
@ -18,6 +18,10 @@ interface Window {
|
||||||
bsEmitter: {
|
bsEmitter: {
|
||||||
on(eventName: string, listener: Function): void
|
on(eventName: string, listener: Function): void
|
||||||
emit(eventName: string, payload: object): void
|
emit(eventName: string, payload: object): void
|
||||||
|
},
|
||||||
|
bsAjax: {
|
||||||
|
get(url: string, params?: object): Promise<object>
|
||||||
|
post(url: string, data?: object): Promise<object>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user