sunabozu / vue-feathers Goto Github PK
View Code? Open in Web Editor NEWIntegration with the Feathers framework for Vue.js
License: MIT License
Integration with the Feathers framework for Vue.js
License: MIT License
Hi,
I have spent the last two days learning from your example which has a good starting point but is outdated. I think I have it working on the latest feathersjs. Can we collaborate on this somehow so others don't have to do this? A Vue/Vuex/Feathersjs is a killer combo.
I am not sure why this happens or if this is actually by design (i hope it's not).
Using two browsers i login with two different users. I then navigate to /something on one of the browsers and then it navigates to the same location on the other browsers. In a way it shares the state since if i set a state in vuex on one browsers it updates the store on the other browser as well.
This seems to be related to the vue-feathers and socket.io as a different project that we have that does the same but we don't use feathers in it does not have this behavior.
Anyone experienced this?
I've basically just run through the set up and I cant seem to get the services bound to vue. Any suggestions?
Here's my client setup.
import Vue from 'vue'
import Resource from 'vue-resource'
import Router from 'vue-router'
// Install plugins
Vue.use(Router)
Vue.use(Resource)
// Set up a new router
const Feathers = require('feathers/client')
const hooks = require('feathers-hooks')
const authentication = require('feathers-authentication/client')
const socketio = require('feathers-socketio/client')
const io = require('socket.io-client')
const socket = io('http://localhost:3030/')
const feathers = Feathers()
.configure(socketio(socket))
.configure(hooks())
.configure(authentication({storage: window.localStorage}))
console.log(feathers)
const vueFeathers = require('vue-feathers')
// And plug it in
Vue.use(vueFeathers, feathers)
Heres the component that is calling it.
export default {
name: "Chat",
data() {
return {
message: ''
}
},
methods: {
send(){
this.$services.messages.create(this.message);
console.log(this.$services);
}
}
}
Error in browser
VM1043:1 Uncaught TypeError: Cannot read property 'create' of undefined
at <anonymous>:1:24
In the current code:
server.service(keys[i]).removeListener(ekeys[k], service[ekeys[k]].bind(this))
The bind(this) will create a new function. removeListener expects a reference to an already bound function. You'll have to store references to the functions added in the created hook in order to remove them properly.
Could you provide an example of front-end authentication using vue-feathers?
This should be stated upfront in the description and readme.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.