You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
			
				
					22 lines
				
				497 B
			
		
		
			
		
	
	
					22 lines
				
				497 B
			| 
								 
											2 years ago
										 
									 | 
							
								import { createStore as create } from 'vuex';
							 | 
						||
| 
								 | 
							
								import { styles, lang, size } from '../config';
							 | 
						||
| 
								 | 
							
								import { setLang } from '../element';
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								const state = {
							 | 
						||
| 
								 | 
							
								  style: styles.noobStyle,
							 | 
						||
| 
								 | 
							
								  lang: lang.chinese,
							 | 
						||
| 
								 | 
							
								  size: size.small,
							 | 
						||
| 
								 | 
							
								};
							 | 
						||
| 
								 | 
							
								setLang(lang.chinese);
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								const mutations = {
							 | 
						||
| 
								 | 
							
								  updateState(state, param) {
							 | 
						||
| 
								 | 
							
								    state[param.prop] = param.value;
							 | 
						||
| 
								 | 
							
								  },
							 | 
						||
| 
								 | 
							
								};
							 | 
						||
| 
								 | 
							
								export const createStore = (options) => {
							 | 
						||
| 
								 | 
							
								  Object.assign(options.state, state);
							 | 
						||
| 
								 | 
							
								  Object.assign(options.mutations, mutations);
							 | 
						||
| 
								 | 
							
								  return create(options);
							 | 
						||
| 
								 | 
							
								};
							 |