mirror of
https://github.com/archtechx/airwire.git
synced 2025-12-12 02:34:04 +00:00
initial
This commit is contained in:
commit
d26fa93f1e
35 changed files with 2388 additions and 0 deletions
19
resources/js/plugins/alpine.ts
Normal file
19
resources/js/plugins/alpine.ts
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
let state = window as any;
|
||||
|
||||
export default () => {
|
||||
const deferrer = state.deferLoadingAlpine || function (callback: CallableFunction) { callback() }
|
||||
|
||||
state.deferLoadingAlpine = function (callback: CallableFunction) {
|
||||
state.Alpine.addMagicProperty('$airwire', (el: any) => {
|
||||
return function (...args: any) {
|
||||
if (args) {
|
||||
return window.Airwire.component(args[0], args[1], el.__x.$data.$reactive)
|
||||
}
|
||||
|
||||
return window.Airwire;
|
||||
}
|
||||
})
|
||||
|
||||
deferrer(callback)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue