Vue.js
- 7 ответов
- 0 вопросов
4
Вклад в тег
async categoryBySlug ({commit}, slug) {
commit(CATEGORY_BY_SLUG)
const response = await axios.get(`${API_BASE}/categories`, {
params: {
slug: slug
}
})
commit(CATEGORY_BY_SLUG_SUCCESS, response.data.data)
},
async allProductsById ({commit}, id) {
commit(ALL_PRODUCTS_BY_ID);
const response = await axios.get(`${API_BASE}/products`, {
params: {
category_id: id
}
})
commit(ALL_PRODUCTS_BY_ID_SUCCESS, response.data.data)
},
$(document).ready(function() {
// all custom jQuery will go here
});