VueJS SPA Example from the 8/27/2019 MKE JS Meetup
npm install
npm run serve
npm run build
npm run test
npm run lint
v-bind
Sets up a reactive element to data in the componentv-bind:key
Sets the unique key so the component can do an in place match: https://forum.vuejs.org/t/simple-clarification-of-when-using-key-with-v-for-is-appropriate-and-why/28966/2 "Tracks the node's identity". Part of what makes Vue super fast!
created()
Lifecycle hook that runs before HTML is injected or bound. We call our Vuex dispatch to load data here.
- GET
- POST
- PUT
- GET (with ID)
- show()
- index()
- store()
- update()
- 0 Nothing Happend Yet
- 1 Loading
- 2 Successful
- 3 Failed
You can watch computed data or data in your component. When these change you can perform a function.
- Dispatch Action
- Run Action
- Call Mutation with new data
- Get Data
- Component re-renders data