Enpoints of Magento bridge for Vuex
import { category } from 'vuex-magento-bridge'
const Category = category(URL, KEY, TIMEOUT)
export default Category
// ...
// in component
import { mixin } from 'vuex-magento-bridge'
export default {
mixins: [
mixin('Category')
],
mounted () {
this.searchAll() // get and store in state 'all'
this.searchAll({ mutation: 'SET_LIST' }) // get and store in state 'list'
this.searchAll({ mutation: 'SET_ALL', page: 1, pagesize: 10}) // get page 1 with 10 products and store in state 'all'
this.searchAll({ mutation: 'SET_ALL', page: 1, pagesize: 10, shuf: true}) // get page 1 with 10 products, suffle and store in state 'all'
}
}
-
searchAll:
function ({mutation = 'SET_ALL', page = 0, pagesize = 0, shuffle = false})
-
SET_ALL:
function (list)
-
getAll:
function ()
-
all:
Array []