-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.app.js
32 lines (31 loc) · 1021 Bytes
/
example.app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import './bootstrap';
import { createApp, h } from 'vue'
import { createInertiaApp } from '@inertiajs/vue3'
import axios from 'axios';
createInertiaApp({
resolve: name => {
const pages = import.meta.glob('./Pages/**/*.vue', { eager: true })
return pages[`./Pages/${name}.vue`]
},
setup({ el, App, props, plugin }) {
createApp({ render: () => {
console.log(props);
window.Rush = new class {
constructor(RushConfig) {
if (RushConfig == null || RushConfig == undefined) {
return {};
}
for (let i in RushConfig) {
this[RushConfig[i].method_name] = function(data) {
return axios[RushConfig[i].http_verb.toLowerCase()](RushConfig[i].relative_url, data);
};
}
}
}(props?.initialPage?.props?.RushConfig);
console.log(App);
return h(App, props);
}})
.use(plugin)
.mount(el)
},
})