File tree Expand file tree Collapse file tree 3 files changed +2
-15
lines changed
lib/generators/inertia_rails/install Expand file tree Collapse file tree 3 files changed +2
-15
lines changed Original file line number Diff line number Diff line change 1
1
import { App } from '@inertiajs/inertia-react' ;
2
2
import React from 'react' ;
3
3
import { render } from 'react-dom' ;
4
- import axios from 'axios' ;
5
4
import { InertiaProgress } from '@inertiajs/progress' ;
6
5
7
6
document . addEventListener ( 'DOMContentLoaded' , ( ) => {
8
7
InertiaProgress . init ( ) ;
9
8
const el = document . getElementById ( 'app' )
10
9
11
- const csrfToken = document . querySelector ( 'meta[name=csrf-token]' ) . content ;
12
- axios . defaults . headers . common [ 'X-CSRF-Token' ] = csrfToken ;
13
-
14
10
render (
15
11
< App
16
12
initialPage = { JSON . parse ( el . dataset . page ) }
17
13
resolveComponent = { name => require ( `../Pages/${ name } ` ) . default }
18
14
/> ,
19
15
el
20
16
)
21
- } ) ;
17
+ } ) ;
Original file line number Diff line number Diff line change 1
- import axios from 'axios'
2
-
3
1
import { createInertiaApp } from '@inertiajs/inertia-svelte'
4
2
import { InertiaProgress } from '@inertiajs/progress'
5
3
6
4
document . addEventListener ( 'DOMContentLoaded' , ( ) => {
7
- const csrfToken = document . querySelector ( 'meta[name=csrf-token]' ) . content
8
- axios . defaults . headers . common [ 'X-CSRF-Token' ] = csrfToken
9
-
10
5
InertiaProgress . init ( )
11
6
12
7
createInertiaApp ( {
@@ -16,4 +11,4 @@ document.addEventListener('DOMContentLoaded', () => {
16
11
new App ( { target : el , props } )
17
12
} ,
18
13
} )
19
- } )
14
+ } )
Original file line number Diff line number Diff line change 1
- import axios from 'axios'
2
1
import Vue from 'vue'
3
2
4
3
import { app , plugin } from '@inertiajs/inertia-vue'
5
4
import { InertiaProgress } from '@inertiajs/progress'
6
5
7
6
document . addEventListener ( 'DOMContentLoaded' , ( ) => {
8
- const csrfToken = document . querySelector ( 'meta[name=csrf-token]' ) . content
9
- axios . defaults . headers . common [ 'X-CSRF-Token' ] = csrfToken
10
-
11
7
InertiaProgress . init ( ) ;
12
8
const el = document . getElementById ( 'app' )
13
9
You can’t perform that action at this time.
0 commit comments