1.2 KiB
1.2 KiB
app.js
Purpose
Main Vue application entry point that sets up the SPA (Single Page Application) architecture with global state management and component loading.
Key Components
createApp()- Vue app instance creationPinia- State management (replaces Vuex)useUserStore()- User state managementuseAuth()- Authentication composable
Exported Interfaces
$navigate- Global navigation helper$user- User store access$auth- Auth composable access$modal- Modal dialog access
Inputs
- Server-side page data via
dataset.page - Component imports from
resources/js/Pages/
Outputs
- Vue app mounted to
#appelement - Global navigation via
$navigatehelper - Async component loading based on current route
Side Effects
- Initializes Pinia state management
- Fetches current user data on startup
- Registers global components (TopHeader, BottomNav)
Dependencies
createApp,h,defineAsyncComponentfrom Vue 3Piniafor state management- Axios for API calls
Notes
- Uses Pinia instead of Vuex for state management
- Async component loading improves performance
- Global
$navigatehelper available for programmatic navigation