import { MutationTree } from 'vuex' ; import { LayoutState , mutations } from '../types' ; import { $g } from '../../utils/config' ; import { $storage } from '../../utils/storage' ; export const mutation = { param state param status [ mutations . layout . collapsed ] ( state , status = null ) { state . collapsed = status ; $storage . set ( $g . caches . storages . collapsed , status ) ; } , param state param opens [ mutations . layout . opens ] ( state , opens ) { state . opens = Array . isArray ( opens ) ? opens : [ opens ] ; } , param state param active [ mutations . layout . active ] ( state , active ) { state . active = active ; } , param state param status [ mutations . layout . drawer ] ( state , status ) { state . drawer = status ; } , param state param status [ mutations . layout . mobile ] ( state , status ) { state . mobile = status ; } , param state param type [ mutations . layout . type ] ( state , type ) { state . type = type ; } , param state param routes [ mutations . layout . routes ] ( state , routes ) { state . routes = routes ; $storage . set ( $g . caches . storages . routes , JSON . stringify ( routes ) ) ; } } ;