Commit 496c8906 authored by jackie / Andrea Ida Malkah Klaura's avatar jackie / Andrea Ida Malkah Klaura
Browse files

add vuex and scaffold store

parent b7ef6f21
......@@ -12201,6 +12201,11 @@
"es6-object-assign": "1.1.0"
}
},
"vuex": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/vuex/-/vuex-3.1.2.tgz",
"integrity": "sha512-ha3jNLJqNhhrAemDXcmMJMKf1Zu4sybMPr9KxJIuOpVcsDQlTBYLLladav2U+g1AvdYDG5Gs0xBTb0M5pXXYFQ=="
},
"watchpack": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.6.0.tgz",
......
......@@ -18,7 +18,8 @@
"vue": "^2.6.10",
"vue-full-calendar": "^2.7.0",
"vue-router": "^3.1.3",
"vuejs-logger": "^1.5.3"
"vuejs-logger": "^1.5.3",
"vuex": "^3.1.2"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^3.11.0",
......
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import BootstrapVue from 'bootstrap-vue'
import VueLogger from 'vuejs-logger';
......@@ -24,5 +25,6 @@ Vue.config.productionTip = false
new Vue({
router,
store,
render: h => h(App)
}).$mount('#app')
import Vue from 'vue'
import Vuex from 'vuex'
import shows from './modules/shows'
import files from './modules/files'
import playlists from './modules/playlists'
Vue.use(Vuex)
const debug = process.env.NODE_ENV !== 'production'
const state = {
items: [],
}
const getters = {
items: state => state.items,
itemCount: state => state.items.length,
}
const actions = {
addItem ({commit}, item) {
commit('addItem', item)
}
}
const mutations = {
addItem (state, item) {
state.items.push(item)
}
}
export default new Vuex.Store({
strict: debug,
modules: {
shows,
files,
playlists,
},
state,
getters,
actions,
mutations,
})
const state = {
items: [],
}
const getters = {
items: state => state.items,
itemCount: state => state.items.length,
}
const actions = {
addItem ({commit}, item) {
commit('addItem', item)
}
}
const mutations = {
addItem (state, item) {
state.items.push(item)
}
}
export default {
namespaced: true,
state,
getters,
actions,
mutations,
}
const state = {
items: [],
}
const getters = {
items: state => state.items,
itemCount: state => state.items.length,
}
const actions = {
addItem ({commit}, item) {
commit('addItem', item)
}
}
const mutations = {
addItem (state, item) {
state.items.push(item)
}
}
export default {
namespaced: true,
state,
getters,
actions,
mutations,
}
const state = {
items: [],
}
const getters = {
items: state => state.items,
itemCount: state => state.items.length,
}
const actions = {
addItem ({commit}, item) {
commit('addItem', item)
}
}
const mutations = {
addItem (state, item) {
state.items.push(item)
}
}
export default {
namespaced: true,
state,
getters,
actions,
mutations,
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment