Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- store/
- index.js
- auth.js
- //index.js
- import Vue from "vue";
- import Vuex from "vuex";
- import auth from "./auth";
- Vue.use(Vuex);
- export default new Vuex.Store({
- modules: {
- auth
- }
- });
- auth.js
- export default {
- namespaced: true,
- state: {
- todos: [
- { id: 1, text: "jedne", done: true },
- { id: 2, text: "dwa", done: false }
- ]
- },
- getters: {
- show: state => {
- return state.todos.filter(todo => todo.done);
- },
- test: state => {
- return state.test;
- }
- },
- mutations: {},
- actions: {}
- };
- //app.js
- require("./bootstrap");
- window.Vue = require("vue");
- import router from "./router";
- import store from "./store";
- import Index from "./Index";
- const app = new Vue({
- el: "#app",
- router,
- store,
- components: {
- Index
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement