Skip to content
This repository was archived by the owner on Mar 8, 2025. It is now read-only.

Commit 1c4d169

Browse files
committed
🔨 Refactor folder structure, vuex store vueServerInit
1 parent 0f4a165 commit 1c4d169

File tree

37 files changed

+234
-155
lines changed

37 files changed

+234
-155
lines changed

aliases.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const prettier = require('prettier')
77
const aliases = {
88
'@': 'src',
99
'@assets': 'src/assets',
10+
'@styles': 'src/styles',
1011
'@components': 'src/components',
1112
'@common': 'src/core/components',
1213
'@uncommon': 'src/components',

jsconfig.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@
2424
"src/assets/index.scss",
2525
"src/assets/index.css"
2626
],
27+
"@styles/*": ["src/styles/*"],
28+
"@styles": [
29+
"src/styles/index.js",
30+
"src/styles/index.json",
31+
"src/styles/index.vue",
32+
"src/styles/index.scss",
33+
"src/styles/index.css"
34+
],
2735
"@components/*": ["src/components/*"],
2836
"@components": [
2937
"src/components/index.js",

src/assets/README.md

Whitespace-only changes.

src/core/layouts/default.vue

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
<template>
22
<div class="default__layout">
33
<Navbar />
4+
<div>
5+
<router-link class="text-primary hover:underline" to="/">
6+
Home
7+
</router-link>
8+
<router-link class="text-primary hover:underline" to="/about">
9+
About
10+
</router-link>
11+
</div>
412
<slot />
513
</div>
614
</template>

src/core/pages/error/404.vue

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<template>
2+
<div
3+
class="notFoundErrorPageComponent flex justify-center items-center h-screen"
4+
>
5+
<div class="text-center">
6+
<h1 class="text-9xl text-white font-black">
7+
404
8+
</h1>
9+
<h2 class="text-6xl text-white font-black">
10+
{{ $t('error.404') }}
11+
</h2>
12+
<div class="mt-5">
13+
<span
14+
@click="$router.go(-1)"
15+
class="inline-block w-16 p-3 m-3 border-white text-white font-bold border-4 rounded-full hover:bg-white hover:text-danger cursor-pointer duration-300"
16+
>
17+
<i class="fas fa-arrow-circle-left"></i>
18+
<span> Back </span>
19+
</span>
20+
<span
21+
@click="$router.push('/')"
22+
class="inline-block w-40 p-3 m-3 border-white text-danger text-lg font-bold border-4 rounded-full bg-white cursor-pointer duration-300"
23+
>
24+
{{ 'Go Home' }}
25+
</span>
26+
</div>
27+
</div>
28+
</div>
29+
</template>
30+
<script>
31+
import { defineComponent, onMounted } from '@vue/composition-api'
32+
// import { bus } from '@plugins/mitt'
33+
export default defineComponent({
34+
name: 'notFoundErrorPage',
35+
setup() {
36+
onMounted(() => {
37+
// bus.emit('layout', 'error')
38+
})
39+
},
40+
})
41+
</script>

src/core/pages/error/500.vue

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<template>
2+
<div
3+
class="internalServerErrorPageComponent flex justify-center items-center h-screen"
4+
>
5+
<div class="text-center">
6+
<h1 class="text-9xl text-white font-black">
7+
500
8+
</h1>
9+
<h2 class="text-6xl text-white font-black">
10+
{{ $route.query.message || $t('error.500') }}
11+
</h2>
12+
<div class="mt-5">
13+
<span
14+
@click="$router.go(-1)"
15+
class="inline-block w-32 p-3 m-3 border-white text-white font-bold border-4 rounded-full hover:bg-white hover:text-danger cursor-pointer duration-300"
16+
>
17+
<i class="fas fa-arrow-circle-left"></i>
18+
<span> Back </span>
19+
</span>
20+
<span
21+
@click="$router.push('/')"
22+
class="inline-block w-40 p-3 m-3 border-white text-danger text-lg font-bold border-4 rounded-full bg-white cursor-pointer duration-300"
23+
>
24+
{{ 'Go Home' }}
25+
</span>
26+
</div>
27+
</div>
28+
</div>
29+
</template>
30+
<script>
31+
import { defineComponent, onMounted } from '@vue/composition-api'
32+
// import { bus } from '@plugins/mitt'
33+
export default defineComponent({
34+
name: 'internalServerErrorPage',
35+
setup() {
36+
onMounted(() => {
37+
// bus.emit('layout', 'error')
38+
})
39+
},
40+
})
41+
</script>

src/core/pages/error/config.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import NotFoundErrorPage from './404.vue'
2+
import InternalServerErrorPage from './500.vue'
3+
4+
export const routes = [
5+
{
6+
name: '404',
7+
path: '/:pathMatch(.*)*',
8+
component: NotFoundErrorPage,
9+
meta: {
10+
layout: 'error',
11+
auth: false,
12+
},
13+
},
14+
{
15+
name: '500',
16+
path: '/error',
17+
component: InternalServerErrorPage,
18+
meta: {
19+
layout: 'error',
20+
auth: false,
21+
},
22+
},
23+
]
24+
25+
export default { routes }
File renamed without changes.
File renamed without changes.

src/core/services/auth.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import axios from 'axios'
2-
import store from '@store'
2+
import { store } from '@store'
33
import dev from '@utils/functions/dev'
44
// Create a custom axios instance
55
export const authApi = axios.create({

0 commit comments

Comments
 (0)