Files
zoff/frontend/main.js
Kasper Rynning-Tønnesen ce8c7d0011 Some mixin and vue socketio
2019-12-04 09:20:09 +01:00

47 lines
962 B
JavaScript

import Vue from "vue";
import VueRouter from "vue-router";
import vuetify from "@/plugins/vuetify"; // path to vuetify export
import router from "./routes";
import store from "./store";
import * as io from "socket.io-client";
import VueSocketIO from "vue-socket.io";
import SortMixin from "@/mixins/SortMixin";
import App from "./App.vue";
Vue.mixin(SortMixin);
Vue.use(VueRouter);
Vue.use(
new VueSocketIO({
debug: true,
connection: io("http://localhost:8080"),
vuex: {
store,
actionPrefix: "SOCKET_",
mutationPrefix: "SOCKET_"
}
})
);
new Vue({
sockets: {
connect: function(msg) {
console.log("connected");
this.$socket.emit("list", {
version: 6,
channel: "summér"
});
},
channel: function(msg) {
console.log("channel-message", msg);
},
np: function(msg) {}
},
vuetify,
el: "#app",
router,
store,
components: { App },
render: h => h(App)
});