mirror of
https://github.com/kevin-DL/comedy-video-lib.git
synced 2026-01-11 10:54:26 +00:00
Creating a github repository
- Creating a github repo so just commiting everything
This commit is contained in:
@@ -18,7 +18,7 @@ export default {
|
||||
{ src: '~/plugins/magic.js', mode: 'client' },
|
||||
{ src: '~/plugins/vue-splide.js', mode: 'client' },
|
||||
{ src: '~/plugins/mirage.js', mode: 'client' },
|
||||
{ src: '~/plugins/axios.js', mode: 'client' },
|
||||
{ src: '~/plugins/axios.js' },
|
||||
],
|
||||
|
||||
// Auto import components (https://go.nuxtjs.dev/config-components)
|
||||
|
||||
@@ -9,6 +9,7 @@ export default function ({ $axios, store }, inject) {
|
||||
})
|
||||
|
||||
// Set baseURL to something different
|
||||
console.log(process.env.baseApiUrl)
|
||||
api.setBaseURL(process.env.baseApiUrl)
|
||||
|
||||
api.onRequest(config => {
|
||||
|
||||
19
store/common.js
Normal file
19
store/common.js
Normal file
@@ -0,0 +1,19 @@
|
||||
export const state = () => ({
|
||||
categories: []
|
||||
})
|
||||
|
||||
export const mutations = {
|
||||
setCategories(state, data) {
|
||||
state.categories = data || []
|
||||
}
|
||||
}
|
||||
|
||||
export const actions = {
|
||||
async getCategories({commit}) {
|
||||
const data = await this.$api.$get('/categories').catch(err => {
|
||||
console.error({err})
|
||||
})
|
||||
console.log(data)
|
||||
commit('setCategories', data?.data || [])
|
||||
}
|
||||
}
|
||||
5
store/index.js
Normal file
5
store/index.js
Normal file
@@ -0,0 +1,5 @@
|
||||
export const actions = {
|
||||
async nuxtServerInit({dispatch}) {
|
||||
await dispatch('common/getCategories')
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user