Created
January 3, 2018 13:02
-
-
Save reynaldobarrosjr/9774656bdc34de07ab33dbc741a950c8 to your computer and use it in GitHub Desktop.
Using Store on Vuejs - Example (Not working)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Using Store on Vuejs - Example </title> | |
| </head> | |
| <body> | |
| <div id="root"></div> | |
| </body> | |
| <script type="https://unpkg.com/vue"></script> | |
| <script type="https://unpkg.com/vuex"></script> | |
| <script type="text/javascript"> | |
| const store = new Vuex.Store({ | |
| state:{ | |
| count:0 | |
| }, | |
| mutations:{ | |
| increment (state){ | |
| state.count++ | |
| } | |
| } | |
| }); | |
| store.commit('increment'); | |
| console.log(store.state.count); | |
| </script> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment