all files / src/ App.vue

81.25% Statements 13/16
100% Branches 4/4
33.33% Functions 1/3
66.67% Lines 6/9
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52                                                                                             
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
 
import ShoppingListComponent from './components/ShoppingListComponent'
import ShoppingListTitleComponent from './components/ShoppingListTitleComponent'
import store from './vuex/store'
import { mapGetters, mapActions } from 'vuex'
import _ from 'underscore'
 
export default {
  components: {
    ShoppingListComponent,
    ShoppingListTitleComponent
  },
  computed: mapGetters({
    shoppinglists: 'getLists'
  }),
  methods: _.extend({}, mapActions(['populateShoppingLists', 'createShoppingList']), {
    addShoppingList () {
      let list = {
        title: 'New Shopping List',
        items: []
      }
 
      this.createShoppingList(list)
    }
  }),
  store,
  mounted () {
    this.populateShoppingLists()
  }
}