-
-
Notifications
You must be signed in to change notification settings - Fork 346
Closed as not planned
Labels
RTDBOld Firebase realtime databaseOld Firebase realtime databasecontribution welcomeIf nobody has proposed a PR for this feature yet, feel free to comment and work on itIf nobody has proposed a PR for this feature yet, feel free to comment and work on itfirestorenew Cloud Storenew Cloud Storetypescript
Description
I am getting typing errors when trying to access props/methods of Vue instance inside of firestore
function. In the example below, uid
is a prop and I get no typing errors when accessing from created
lifecycle hook, but it is not defined inside firestore function.
export default Vue.extend({
props: ['uid'],
created() {
console.log({ uid: this.uid }) // this.uid is fine
},
firestore() {
// Error: "Property 'uid' doesn't exist on type Vue"
const uid = this.uid
return {
user: db.doc(`users/${uid}`),
}
},
})
This can resolve the issue, but shouldn't be necessary:
const uid = (this as any).uid
geekkun
Metadata
Metadata
Assignees
Labels
RTDBOld Firebase realtime databaseOld Firebase realtime databasecontribution welcomeIf nobody has proposed a PR for this feature yet, feel free to comment and work on itIf nobody has proposed a PR for this feature yet, feel free to comment and work on itfirestorenew Cloud Storenew Cloud Storetypescript