Skip to content

Instantly share code, notes, and snippets.

@reynaldobarrosjr
Created January 3, 2018 13:02
Show Gist options
  • Select an option

  • Save reynaldobarrosjr/9774656bdc34de07ab33dbc741a950c8 to your computer and use it in GitHub Desktop.

Select an option

Save reynaldobarrosjr/9774656bdc34de07ab33dbc741a950c8 to your computer and use it in GitHub Desktop.
Using Store on Vuejs - Example (Not working)
<!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