'Can I make commit's and dispatches form methodes or hooks?
Hello i'm looking for a way to make the mutation using onMounted in one of my components. For example:
mutation:{
letPrintSth(){
console.log("hello i'm in vuex");
}
}
onMounted:{()=>{
this.$store.commit('letPrintSth')
}}
but this way it throw err
- Property '$store' does not exist on type 'void'.
Can someone show me the proper way to do this?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
