From 1a6f65314dbb888c06ec81dbcabf7f0f28fde985 Mon Sep 17 00:00:00 2001 From: Mohamed Jinas Date: Thu, 24 Sep 2020 00:52:13 +0500 Subject: [PATCH] turbo links intergrate --- package-lock.json | 13 +++++++++++++ package.json | 4 +++- resources/js/app.js | 12 +++++++++++- 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index fbd6dae..45f12a7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9159,6 +9159,11 @@ "integrity": "sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY=", "dev": true }, + "turbolinks": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/turbolinks/-/turbolinks-5.2.0.tgz", + "integrity": "sha512-pMiez3tyBo6uRHFNNZoYMmrES/IaGgMhQQM+VFF36keryjb5ms0XkVpmKHkfW/4Vy96qiGW3K9bz0tF5sK9bBw==" + }, "type": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz", @@ -9521,6 +9526,14 @@ "integrity": "sha512-4gDntzrifFnCEvyoO8PqyJDmguXgVPxKiIxrBKjIowvL9l+N66196+72XVYR8BBf1Uv1Fgt3bGevJ+sEmxfZzw==", "dev": true }, + "vue-turbolinks": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/vue-turbolinks/-/vue-turbolinks-2.1.0.tgz", + "integrity": "sha512-Rgq9eUS2LgHVoSR58S0utW7g/aqLlVZ6uM7S1e02+xEUGKW1fqhUHQXea3p+cE59ldf+f3nz3Cc3HVO4MlrTFA==", + "requires": { + "vue": "^2.2.4" + } + }, "watchpack": { "version": "1.7.4", "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.7.4.tgz", diff --git a/package.json b/package.json index 83df133..36e668a 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,8 @@ "dependencies": { "moment": "^2.28.0", "tailwindcss": "^1.6.2", - "vue": "^2.6.11" + "turbolinks": "^5.2.0", + "vue": "^2.6.11", + "vue-turbolinks": "^2.1.0" } } diff --git a/resources/js/app.js b/resources/js/app.js index c76257c..7ec777c 100644 --- a/resources/js/app.js +++ b/resources/js/app.js @@ -1,6 +1,8 @@ require('./bootstrap'); import Vue from 'vue'; +import Turbolinks from 'turbolinks'; +import TurbolinksAdapter from 'vue-turbolinks'; import TodaysPick from "./components/TodaysPick"; import DiscoverTopics from "./components/DiscoverTopics"; @@ -9,7 +11,13 @@ import AvailableSources from './components/AvailableSources'; import SourceView from './components/SourceView'; import NewsLetter from './components/NewsLetter'; -const app = new Vue({ +Turbolinks.start(); + +Vue.use(TurbolinksAdapter); + +document.addEventListener('turbolinks:load', () => { + +let app = new Vue({ el: '#app', components: { TodaysPick, @@ -20,3 +28,5 @@ const app = new Vue({ NewsLetter } }); + +});