assets
2 months ago
components
1 week ago
composables
1 month ago
data
1 month ago
directives
10 months ago
router
1 year ago
stores
3 months ago
styles
4 months ago
types
2 months ago
utils
9 months ago
views
3 weeks ago
App.vue
1 year ago
main.ts
8 months ago
main.ts
43 lines
| 1 | import { HButton, HCard, HCheckbox, HIcon, HSnackbar, HText, HToast, useTheme } from '@hostinger/hcomponents'; |
| 2 | import { createPinia } from 'pinia'; |
| 3 | import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'; |
| 4 | import { createApp } from 'vue'; |
| 5 | |
| 6 | import './styles/main.scss'; |
| 7 | |
| 8 | import App from './App.vue'; |
| 9 | import { setDirectives } from './directives'; |
| 10 | import router from './router'; |
| 11 | |
| 12 | const initializeVueApp = () => { |
| 13 | const app = createApp(App); |
| 14 | const pinia = createPinia(); |
| 15 | const { setThemeOnly } = useTheme(); |
| 16 | |
| 17 | setThemeOnly('base'); |
| 18 | pinia.use(piniaPluginPersistedstate); |
| 19 | |
| 20 | app.use(router); |
| 21 | app.use(pinia); |
| 22 | |
| 23 | app.component('HButton', HButton); |
| 24 | app.component('HCard', HCard); |
| 25 | app.component('HIcon', HIcon); |
| 26 | app.component('HSnackbar', HSnackbar); |
| 27 | app.component('HText', HText); |
| 28 | app.component('HToast', HToast); |
| 29 | app.component('HCheckbox', HCheckbox); |
| 30 | |
| 31 | setDirectives(app); |
| 32 | |
| 33 | app.mount('#hostinger-reach-app'); |
| 34 | }; |
| 35 | |
| 36 | document.addEventListener('DOMContentLoaded', () => { |
| 37 | const targetElement = document.getElementById('hostinger-reach-app'); |
| 38 | |
| 39 | if (targetElement) { |
| 40 | initializeVueApp(); |
| 41 | } |
| 42 | }); |
| 43 |