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 @@ ...@@ -12201,6 +12201,11 @@
"es6-object-assign": "1.1.0" "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": { "watchpack": {
"version": "1.6.0", "version": "1.6.0",
"resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.6.0.tgz", "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.6.0.tgz",
......
...@@ -18,7 +18,8 @@ ...@@ -18,7 +18,8 @@
"vue": "^2.6.10", "vue": "^2.6.10",
"vue-full-calendar": "^2.7.0", "vue-full-calendar": "^2.7.0",
"vue-router": "^3.1.3", "vue-router": "^3.1.3",
"vuejs-logger": "^1.5.3" "vuejs-logger": "^1.5.3",
"vuex": "^3.1.2"
}, },
"devDependencies": { "devDependencies": {
"@vue/cli-plugin-babel": "^3.11.0", "@vue/cli-plugin-babel": "^3.11.0",
......
import Vue from 'vue' import Vue from 'vue'
import App from './App.vue' import App from './App.vue'
import router from './router' import router from './router'
import store from './store'
import BootstrapVue from 'bootstrap-vue' import BootstrapVue from 'bootstrap-vue'
import VueLogger from 'vuejs-logger'; import VueLogger from 'vuejs-logger';
...@@ -24,5 +25,6 @@ Vue.config.productionTip = false ...@@ -24,5 +25,6 @@ Vue.config.productionTip = false
new Vue({ new Vue({
router, router,
store,
render: h => h(App) render: h => h(App)
}).$mount('#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,
}
Supports Markdown
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