| Total Complexity | 2 |
| Complexity/F | 1 |
| Lines of Code | 29 |
| Function Count | 2 |
| Duplicated Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | import axios from 'axios'; |
||
| 2 | import DriverConfigsComponent from './driver_configs'; |
||
| 3 | import Vue from 'vue'; |
||
| 4 | |||
| 5 | // register global utilities |
||
| 6 | require('assets/js/boot'); |
||
| 7 | |||
| 8 | $(function() { |
||
| 9 | // find the element we're going to mount our component to |
||
| 10 | const el = document.querySelector('[data-component=driver-configs]'); |
||
| 11 | |||
| 12 | // parse our props from data attributes |
||
| 13 | const drivers = JSON.parse(el.dataset.drivers); |
||
| 14 | const lang = JSON.parse(el.dataset.lang); |
||
| 15 | |||
| 16 | // configure axios with our csrf token |
||
| 17 | axios.defaults.headers.common['X-CSRF-TOKEN'] = el.dataset.token; |
||
| 18 | |||
| 19 | // instantiate our component and mount it to the dom |
||
| 20 | new Vue({ |
||
|
|
|||
| 21 | el, |
||
| 22 | render: h => h(DriverConfigsComponent, { |
||
| 23 | props: { |
||
| 24 | drivers, |
||
| 25 | lang, |
||
| 26 | }, |
||
| 27 | }), |
||
| 28 | }); |
||
| 29 | }); |
||
| 30 |