Skip to content

Commit d87e2bb

Browse files
committed
feat(scaffolding): add initial folder structure
1 parent 7815e91 commit d87e2bb

31 files changed

+266
-296
lines changed

src/components/AboutView.vue

-19
This file was deleted.

src/components/AppComponent.vue

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<script setup lang="ts">
2+
import { ref } from 'vue';
3+
import { RouterView } from 'vue-router';
4+
5+
import { NavbarComponent } from '~/components/common';
6+
import { LoginComponent } from '~/components/views/login';
7+
8+
import { useI18n } from '~/utils';
9+
10+
const i18n = useI18n('global');
11+
const isAuthenticated = ref(true);
12+
</script>
13+
14+
<template>
15+
<LoginComponent v-if="!isAuthenticated" />
16+
<template v-else>
17+
<header>
18+
<NavbarComponent />
19+
</header>
20+
<main>
21+
<RouterView />
22+
</main>
23+
</template>
24+
</template>
25+
26+
<style lang="scss" scoped>
27+
header {
28+
display: flex;
29+
flex-direction: column;
30+
justify-content: center;
31+
}
32+
33+
main {
34+
padding: 0 2rem;
35+
}
36+
</style>

src/components/AppView.vue

-68
This file was deleted.

src/components/HelloWorld.spec.ts

-11
This file was deleted.

src/components/HelloWorld.vue

-32
This file was deleted.

src/components/HomeView.vue

-7
This file was deleted.

src/components/TheWelcome.vue

-77
This file was deleted.

src/components/WelcomeItem.vue

-50
This file was deleted.

src/components/common/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './navbar';
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<script lang="ts" setup>
2+
import { NButton, NButtonGroup } from 'naive-ui';
3+
import { RouterLink } from 'vue-router';
4+
5+
import { Route } from '~/router';
6+
import { useRouterStore } from '~/stores/router.store';
7+
import { useI18n } from '~/utils';
8+
9+
const store = useRouterStore();
10+
const i18n = useI18n('route');
11+
12+
const routes = [Route.Progress, Route.Calendar, Route.History, Route.List, Route.Search, Route.Settings];
13+
</script>
14+
15+
<template>
16+
<nav>
17+
<NButtonGroup class="buttons">
18+
<template v-for="(route, index) in routes" :key="route">
19+
<RouterLink v-slot="{ href, navigate, isActive }" :to="`${ store.baseName }/${route}`" custom>
20+
<NButton :round="index === 0 || index === routes.length - 1" :class="{ active: isActive }" :href="href" @click="navigate">
21+
{{ i18n(route.toLowerCase()) }}
22+
</NButton>
23+
</RouterLink>
24+
</template>
25+
</NButtonGroup>
26+
</nav>
27+
</template>
28+
29+
<style lang="scss" scoped>
30+
nav {
31+
margin-top: 2rem;
32+
font-size: 12px;
33+
text-align: center;
34+
}
35+
36+
.buttons {
37+
display: flex;
38+
justify-content: center;
39+
40+
.active {
41+
color: var(--n-text-color-pressed);
42+
background-color: var(--n-color-pressed);
43+
}
44+
}
45+
</style>

src/components/common/navbar/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default as NavbarComponent } from './NavbarComponent.vue';
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<script lang="ts" setup>
2+
// TODO
3+
</script>
4+
5+
<template>
6+
<span>This is a calendar component</span>
7+
</template>
8+
9+
<style lang="scss" scoped>
10+
// TODO
11+
</style>
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default as CalendarComponent } from './CalendarComponent.vue';
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<script lang="ts" setup>
2+
// TODO
3+
</script>
4+
5+
<template>
6+
<span>This is a history component</span>
7+
</template>
8+
9+
<style lang="scss" scoped>
10+
// TODO
11+
</style>

src/components/views/history/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default as HistoryComponent } from './HistoryComponent.vue';
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<script lang="ts" setup>
2+
// TODO
3+
</script>
4+
5+
<template>
6+
<span>This is a list component</span>
7+
</template>
8+
9+
<style lang="scss" scoped>
10+
// TODO
11+
</style>

src/components/views/list/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default as ListComponent } from './ListComponent.vue';

0 commit comments

Comments
 (0)