File tree 4 files changed +15
-16
lines changed
4 files changed +15
-16
lines changed Original file line number Diff line number Diff line change 1
- import Vue from 'vue' ;
2
- import './bootstrap' ;
3
- import ExampleComponent from './components/ExampleComponent.vue' ;
1
+ import './bootstrap'
2
+ import Vue from 'vue'
3
+ import ExampleComponent from './components/ExampleComponent.vue'
4
4
5
5
new Vue ( {
6
6
el : '#app' ,
Original file line number Diff line number Diff line change 1
- import Axios , { AxiosStatic } from 'axios' ;
1
+ import Axios , { AxiosStatic } from 'axios'
2
2
3
3
declare global {
4
4
interface Window {
5
- axios : AxiosStatic ;
5
+ axios : AxiosStatic
6
6
}
7
+
7
8
interface Element {
8
- content : string ;
9
+ content : string
9
10
}
10
11
}
11
12
12
13
export default function bootstrap ( ) {
14
+ window . axios = Axios
15
+ window . axios . defaults . headers . common [ 'X-Requested-With' ] = 'XMLHttpRequest'
13
16
14
- window . axios = Axios ;
15
-
16
- window . axios . defaults . headers . common [ 'X-Requested-With' ] = 'XMLHttpRequest' ;
17
-
18
- let token = document . head . querySelector ( 'meta[name="csrf-token"]' ) ;
17
+ let token = document . head . querySelector ( 'meta[name="csrf-token"]' )
19
18
20
19
if ( token ) {
21
- window . axios . defaults . headers . common [ 'X-CSRF-TOKEN' ] = token . content ;
20
+ window . axios . defaults . headers . common [ 'X-CSRF-TOKEN' ] = token . content
22
21
} else {
23
- console . error ( 'CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token' ) ;
22
+ console . error ( 'CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token' )
24
23
}
25
24
26
25
}
Original file line number Diff line number Diff line change 15
15
</template >
16
16
17
17
<script lang="ts">
18
- import {Vue , Component } from ' vue-property-decorator' ;
18
+ import {Vue , Component } from ' vue-property-decorator'
19
19
20
20
@Component
21
21
export default class ExampleComponent extends Vue {
Original file line number Diff line number Diff line change 1
1
declare module "*.vue" {
2
- import Vue from "vue" ;
3
- export default Vue ;
2
+ import Vue from "vue"
3
+ export default Vue
4
4
}
You can’t perform that action at this time.
0 commit comments