turbo links intergrate

This commit is contained in:
2020-09-24 00:52:13 +05:00
parent 21dda46981
commit 1a6f65314d
3 changed files with 27 additions and 2 deletions

13
package-lock.json generated
View File

@@ -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",

View File

@@ -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"
}
}

12
resources/js/app.js vendored
View File

@@ -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
}
});
});