From 76db1006cca54f0364b313bef604ac59c5f9b1f0 Mon Sep 17 00:00:00 2001 From: Wayne Harris Date: Thu, 22 Sep 2016 10:36:43 +0100 Subject: [PATCH 01/21] Update Vue Resource Propose updating Vue Resource. Will require changing the way the X-CSRF-TOKEN header in bootstrap.js This seems to be compatible with Larval Passport --- package.json | 2 +- resources/assets/js/bootstrap.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index d490671c..4c6745cd 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,6 @@ "laravel-elixir-webpack-official": "^1.0.2", "lodash": "^4.14.0", "vue": "^1.0.26", - "vue-resource": "^0.9.3" + "vue-resource": "^1.0.2" } } diff --git a/resources/assets/js/bootstrap.js b/resources/assets/js/bootstrap.js index 3f4c5cf5..a2f3529f 100644 --- a/resources/assets/js/bootstrap.js +++ b/resources/assets/js/bootstrap.js @@ -26,7 +26,7 @@ require('vue-resource'); */ Vue.http.interceptors.push((request, next) => { - request.headers['X-CSRF-TOKEN'] = Laravel.csrfToken; + request.headers.set('X-CSRF-TOKEN', Laravel.csrfToken); next(); }); From 1117be09e7f38b20f9acf9430c589644b44c28ea Mon Sep 17 00:00:00 2001 From: Erik Telford Date: Sun, 2 Oct 2016 21:33:25 -0500 Subject: [PATCH 02/21] Use vue 2 and elixir-vue-2 --- gulpfile.js | 2 +- package.json | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 04d503d8..442dd3fd 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,6 +1,6 @@ const elixir = require('laravel-elixir'); -require('laravel-elixir-vue'); +require('laravel-elixir-vue-2'); /* |-------------------------------------------------------------------------- diff --git a/package.json b/package.json index 4c6745cd..e9993aa8 100644 --- a/package.json +++ b/package.json @@ -9,10 +9,10 @@ "gulp": "^3.9.1", "jquery": "^3.1.0", "laravel-elixir": "^6.0.0-9", - "laravel-elixir-vue": "^0.1.4", + "laravel-elixir-vue-2": "^0.2.0", "laravel-elixir-webpack-official": "^1.0.2", - "lodash": "^4.14.0", - "vue": "^1.0.26", - "vue-resource": "^1.0.2" + "lodash": "^4.16.2", + "vue": "^2.0.1", + "vue-resource": "^1.0.3" } } From 6f9a450f5c43dc9c05f0af25e187e537916729cc Mon Sep 17 00:00:00 2001 From: Erik Telford Date: Sun, 2 Oct 2016 21:33:42 -0500 Subject: [PATCH 03/21] Bind to #app instead of body --- resources/assets/js/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/assets/js/app.js b/resources/assets/js/app.js index 87dd5ad1..a8eb8e2d 100644 --- a/resources/assets/js/app.js +++ b/resources/assets/js/app.js @@ -16,5 +16,5 @@ require('./bootstrap'); Vue.component('example', require('./components/Example.vue')); const app = new Vue({ - el: 'body' + el: '#app' }); From e0573e67e00ce172ef895862d14a81cd0ca2cadf Mon Sep 17 00:00:00 2001 From: Erik Telford Date: Sun, 2 Oct 2016 21:33:52 -0500 Subject: [PATCH 04/21] Use mounted instead of ready --- resources/assets/js/components/Example.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/assets/js/components/Example.vue b/resources/assets/js/components/Example.vue index 067ef661..86a0b70f 100644 --- a/resources/assets/js/components/Example.vue +++ b/resources/assets/js/components/Example.vue @@ -16,7 +16,7 @@