23 lines
		
	
	
		
			450 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			23 lines
		
	
	
		
			450 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| import { createApp } from 'vue';
 | |
| 
 | |
| import { createPersistedState } from 'pinia-plugin-persistedstate';
 | |
| 
 | |
| import App from './App.vue';
 | |
| import router from './router';
 | |
| import { pinia } from './store';
 | |
| 
 | |
| import './style/index.scss';
 | |
| 
 | |
| // 添加持久化插件
 | |
| pinia.use(
 | |
|   createPersistedState({
 | |
|     auto: true, // 自动持久化所有 store
 | |
|     storage: localStorage
 | |
|   })
 | |
| );
 | |
| 
 | |
| const app = createApp(App);
 | |
| app.use(router);
 | |
| app.use(pinia);
 | |
| app.mount('#app');
 | 
