Skip to content

vm data not initialised in firebase function #66

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
posva opened this issue Jan 29, 2017 · 1 comment
Closed

vm data not initialised in firebase function #66

posva opened this issue Jan 29, 2017 · 1 comment

Comments

@posva
Copy link
Member

posva commented Jan 29, 2017

As pointed out in #63
When using the function syntax:

data: {
  user: 'posva'
},
firebase () {
  return {
    someRef: db.ref('users/' + this.user) // this.user === undefined
  }
}

user should not be undefined

@posva posva closed this as completed in 4a687f0 Jan 29, 2017
@RobertAKARobin
Copy link

RobertAKARobin commented Feb 9, 2017

I'm still encountering this:

<widget :fbid="myKey"></widget>
var Widget = Vue.component('widget', {
	props: ['fbid'],
	firebase: function(){
		var widget = this;
		return {
			fbdata: {
				source: db.ref('/widgets').child(widget.fbid),
				asObject: true
			}
		}
	}
});
Error: Firebase.child failed: First argument was an invalid path: "undefined". Paths must be non-empty strings and can't contain ".", "#", "$", "[", or "]"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants