ВБ
Size: a a a
ВБ
ВБ
ВБ
ВБ
isAuthenticated(state) {
return state.auth.loggedIn
},ВБ
ВБ
m
ВБ
ВБ
m
ВБ
ВБ
async nuxtServerInit({ dispatch }, { req }) {
await dispatch('favorite/START_FAVORITE')
}
export const actions = {
START_FAVORITE({ commit }) {
const favorites = this.$cookies.get('favorites')
if (favorites && favorites.length > 0) {
commit('set', favorites)
}
},
}
Мутацияexport const mutations = {
set(state, favoriteList) {
state.favoriteList = favoriteList
},
}
В стейте у меняexport const state = () => ({
favoriteList: []
})ВБ
m
ВБ
m
m
ВБ
N
window.DARK_MODE = typeof fromLocalStorage !== 'undefined'
? lockr.get(DARK_THEME_ENABLED_KEY)
: window.DARK_MODE
window.CSS_VARS = cssVars
ВБ