vue-typescript-util
write vue with type check
this module only work with/.tsx?/
file
important
to make VueComponent
active.
you have to create a jsx.d.ts
file in project root like this
you may need this => how it worked and preview
exposed
- vue
- VueComponent
- vuex
- MakeVuexModule
- BindToRootMutation
- BindToRootActions
- InjectStore
usage
see folder
demo
VueComponent<Props={}, store extends Store<any> = Store<any>>
withvue-class-component
you can use type checking;;;//use MyComponent in MyComponent1
vuex
about -
define vuex module State
// declartion migration globalStatedeclare -
define vuex module getters
//AppStoreGetters globalGetters typedeclare -
define vuex mutations
// AppStoreMutations global mutation typedeclare -
define vuex Actions
declare -
define vuex module
MakeVuexModule(moduleTree:_moduleTree,moduleName: string,namespace: boolean = false)
// no namespaced;;// wrap of BindToRootActionsregisteActionsEventModule.actions, 'event';// wrap of BindToRootMutationregisteMutationsEventModule.mutations, 'event';//this is vuex module -
global store
type define global Storedefine global Actions and Mutaions , then we can use declaration migration to enhance them;
;;//wrap of Bindings to StoreActions/StoreMutationstype define utils of GetterModule,MutationModule,ActionModule
;;;define vuex store and InjectIt
;;;InjectStorestore;// after//you can use store.Commit with StoreMutations//you can use store.Dispatch with StoreMutations// define a class Injected AppStore