https://github.com/ujjwalguptaofficial/godam-vue
https://github.com/ujjwalguptaofficial/godam-vue
Last synced: 6 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/ujjwalguptaofficial/godam-vue
- Owner: ujjwalguptaofficial
- License: mit
- Created: 2021-06-26T06:06:33.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-08-30T02:04:29.000Z (about 4 years ago)
- Last Synced: 2025-03-09T01:04:49.474Z (7 months ago)
- Language: Vue
- Size: 666 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# godam-vue
Godam plugin for vue framework.
# Installation
```
npm i godam-vue
```# Guide
## Create your store
```
import { Godam, Mutation, Expression, Task } from "godam";export class State {
name = "ujjwal"
}export class RootMutation extends Mutation {
name(value) {
this.state.name = value;
}
}export const store = new Godam({
state: State,
mutation: RootMutation
});
```## Setup plugin
```
import GodamPlugin from "godam-vue";
Vue.use(GodamPlugin, store);
```now `store` is mounted on `$store` in component.
## Use store in your component
```
{{ name }}
import { mapState, mapTask, mapExpression } from "godam-vue";
export default {
computed: {
...mapState(["name"])
},
methods:{
getName(){
return this.$store.get('name')
}
}
};```