Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Vue.use(VueResource);
- import Vue from 'vue'
- import TurbolinksAdapter from 'vue-turbolinks'
- import VueResource from 'vue-resources'
- document.addEventListener('turbolinks:load', () => {
- Vue.http.headers.common['X-CSRF-token'] = document.querySelector('meta[name = "csrf-token"]').getAttribute('content')
- var element = document.getElementById('team-form');
- if (element != null) {
- var team = JSON.parse(element.dataset.team);
- var players_attributes = JSON.parse(element.dataset.playersAttributes);
- players_attributes.forEach(function (player) {
- player._destroy = null;
- });
- var app = new Vue({
- el: element,
- mixins: [TurbolinksAdapter],
- data: function () {
- return {team: team}
- }
- })
- console.log(app)
- }
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement