type Theme = 'light' | 'dark' ; export const state = ( ) => ( { locales : [ 'en' , 'zh-cn' ] , locale : 'en' , theme : 'light' , } ) ; export const mutations = { SET_LANG ( state , locale ) { if ( state . locales . includes ( locale ) ) { state . locale = locale ; } } , SET_THEME ( state , theme ) { state . theme = theme ; } , } ;