Sha256: 3514549d38daf55f5b6d5320efe7a8aa506a770c2f266fb53b39ce72dd2b4cf9

Contents?: true

Size: 648 Bytes

Versions: 7

Compression:

Stored size: 648 Bytes

Contents

import axios from 'axios'
import Vue from 'vue'

import { app, plugin } from '@inertiajs/inertia-vue'
import { InertiaProgress } from '@inertiajs/progress'

document.addEventListener('DOMContentLoaded', () => {
  const csrfToken = document.querySelector('meta[name=csrf-token]').content
  axios.defaults.headers.common['X-CSRF-Token'] = csrfToken

  InertiaProgress.init();
  const el = document.getElementById('app')

  Vue.use(plugin)

  new Vue({
    render: h => h(app, {
      props: {
        initialPage: JSON.parse(el.dataset.page),
        resolveComponent: name => require(`../Pages/${name}`).default,
      },
    }),
  }).$mount(el)
})

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
inertia_rails-3.0.0 lib/generators/inertia_rails/install/vue/inertia.js
inertia_rails-2.0.1 lib/generators/inertia_rails/install/vue/inertia.js
inertia_rails-2.0.0 lib/generators/inertia_rails/install/vue/inertia.js
inertia_rails-1.12.1 lib/generators/inertia_rails/install/vue/inertia.js
inertia_rails-1.12.0 lib/generators/inertia_rails/install/vue/inertia.js
inertia_rails-1.11.1 lib/generators/inertia_rails/install/vue/inertia.js
inertia_rails-1.11.0 lib/generators/inertia_rails/install/vue/inertia.js