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 11import { App } from '@inertiajs/inertia-react' ;
22import React from 'react' ;
33import { render } from 'react-dom' ;
4- import axios from 'axios' ;
54import { InertiaProgress } from '@inertiajs/progress' ;
65
76document . addEventListener ( 'DOMContentLoaded' , ( ) => {
87 InertiaProgress . init ( ) ;
98 const el = document . getElementById ( 'app' )
109
11- const csrfToken = document . querySelector ( 'meta[name=csrf-token]' ) . content ;
12- axios . defaults . headers . common [ 'X-CSRF-Token' ] = csrfToken ;
13-
1410 render (
1511 < App
1612 initialPage = { JSON . parse ( el . dataset . page ) }
1713 resolveComponent = { name => require ( `../Pages/${ name } ` ) . default }
1814 /> ,
1915 el
2016 )
21- } ) ;
17+ } ) ;
Original file line number Diff line number Diff line change 1- import axios from 'axios'
2-
31import { createInertiaApp } from '@inertiajs/inertia-svelte'
42import { InertiaProgress } from '@inertiajs/progress'
53
64document . addEventListener ( 'DOMContentLoaded' , ( ) => {
7- const csrfToken = document . querySelector ( 'meta[name=csrf-token]' ) . content
8- axios . defaults . headers . common [ 'X-CSRF-Token' ] = csrfToken
9-
105 InertiaProgress . init ( )
116
127 createInertiaApp ( {
@@ -16,4 +11,4 @@ document.addEventListener('DOMContentLoaded', () => {
1611 new App ( { target : el , props } )
1712 } ,
1813 } )
19- } )
14+ } )
Original file line number Diff line number Diff line change 1- import axios from 'axios'
21import Vue from 'vue'
32
43import { app , plugin } from '@inertiajs/inertia-vue'
54import { InertiaProgress } from '@inertiajs/progress'
65
76document . addEventListener ( 'DOMContentLoaded' , ( ) => {
8- const csrfToken = document . querySelector ( 'meta[name=csrf-token]' ) . content
9- axios . defaults . headers . common [ 'X-CSRF-Token' ] = csrfToken
10-
117 InertiaProgress . init ( ) ;
128 const el = document . getElementById ( 'app' )
139
You can’t perform that action at this time.
0 commit comments