index.js 497 Bytes
import Vue from 'vue';
import Vuex from 'vuex';
Vue.use(Vuex);

export default new Vuex.Store({
	state: {
		tags: [],
		videoList: [],
	},
	mutations: {
		setTags(state, tags) {
			state.tags = tags;
		},
		setVideoList(state, list) {
			state.videoList = list;
		},
	},
	getters: {
		getTags: (state) => {
			return state.tags;
		},
		getList: (state) => {
			return state.videoList;
		},
	},
	actions: {
		LoadTags: (context) => {
			return context.commit('setTags');
		},
	},
	modules: {},
});