Integration with Typescript and Vue Composition API
See original GitHub issueI am currently running into an error with typescript. When I try to get $FeathersVuex from context.root as shown below
setup(props, context) {
const { User } = context.root.$FeathersVuex.api
}
I’m getting an error Property '$FeathersVuex' does not exist on type 'CombinedVueInstance<Vue, object, object, object, Record<never, any>>'
. Is there any default typings that FeathersVuex provides to silence this error?
The code runs but I’m getting the error and don’t know why 😦
Versions
"@feathersjs/authentication-client": "^4.5.8",
"@feathersjs/feathers": "^4.5.8",
"@feathersjs/socketio-client": "^4.5.8",
"@vue/composition-api": "^1.0.0-beta.10",
"feathers-hooks-common": "^5.0.3",
"feathers-vuex": "^3.11.5",
"socket.io-client": "^2.3.0",
"vue": "^2.6.11",
"vue-router": "^3.2.0",
"vuex": "^3.4.0",
System
MacOS Catalina 10.15.4
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
TypeScript with Composition API - Vue.js
TypeScript with Composition API # · Typing Component Props · Typing Component Emits · Typing ref() · Typing reactive() · Typing computed() ·...
Read more >Building Web Apps with Vue 3 composition API + Typescript + ...
The composition API is a new API for creating components in vue 3. It presents a clean and flexible way to compose logic...
Read more >How to apply Vue Composition API & Vuex 4 with Typescript
Vue Composition API is function-based APIs that provides flexibility, improves code readability, and helps to maintain component logic. The main reason for ...
Read more >Migrate to VueJS 3, Composition API, and TypeScript? - DZone
Maybe you'll have to change something, but your project written in pure JS and Vue 2 should also work in this configuration. You...
Read more >Vue JS 3: The Composition API (Inc Script Setup, TypeScript)
Learn to build a complex, real world application with the Composition API, TypeScript, Pinia and Vue Router, taught by Lachlan Miller. maintainer of...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Oh, very cool. I still consider myself a TypeScript n00b, since Feathers-Vuex is literally the only place I’ve ever used it. Thanks for being so comprehensive! 😄
Actually that augmentation is done for you from 3.12.0. Take a look at https://github.com/feathersjs-ecosystem/feathers-vuex/blob/master/src/vue-plugin/vue-plugin.ts#L16.
If you want more explicit typing (e.g. with your models), then follow along with the new docs at https://vuex.feathersjs.com/model-classes.html#basemodel-typing