chore: Refactored home page content out of App.vue and into separate index.vue file created for the vue-router

This commit is contained in:
jezzahehn 2025-05-20 18:21:58 -04:00
parent da604a14f6
commit 297947266d
4 changed files with 42 additions and 57 deletions

View file

@ -4,45 +4,18 @@
<RouterLink to="/">Home</RouterLink>
<RouterLink to="/resources">Resources</RouterLink>
</nav>
<RouterView />
<section class="section">
<h1 class="title has-text-black p-6">BRÅTULA VIOSSA.NET MÅDE</h1>
</section>
<section class="section">
<HomeSectionWrapper
v-for="(section, index) in sectionList"
:key="index"
:title="section.title"
:text="section.text"
:image="section.image"
:alt="section.alt"
:reverse="index % 2 !== 0"
/>
</section>
</div>
</template>
<script lang="ts">
import PaddingWrapper from './components/molecules/PaddingWrapper.vue'
import IntroSection from './components/organisms/IntroSection.vue'
import HistorySection from './components/organisms/HistorySection.vue'
<script setup lang="ts">
// import HomeSectionWrapper from './components/molecules/HomeSectionWrapper.vue'
import './assets/style.scss'
import 'bulma/css/bulma.css'
// import { useI18n } from 'vue-i18n'
// import type { MessageSchema } from './i18n/types'
export default {
name: 'app',
components: {
PaddingWrapper,
IntroSection,
HistorySection
},
data() {
return {
sectionList: ['IntroSection', 'HistorySection']
}
}
}
// const { t, tm } = useI18n()
// console.log(sectionList.value)
</script>

View file

@ -1,32 +1,34 @@
<template>
<div class="min-h-screen flex flex-col" style="gap: 4rem">
<!-- Main application wrapper -->
<!-- <SideBar /> -->
<section class="section">
<h1 class="title has-text-black p-6">BRÅTULA VIOSSA.NET MÅDE</h1>
</section>
<h1 class="title has-text-black p-6">BRÅTULA VIOSSA.NET MÅDE</h1>
<PaddingWrapper
v-for="(sectionName, index) in sectionList"
:key="index"
>
<component :is="sectionName" />
</PaddingWrapper>
<section class="section">
<HomeSectionWrapper
v-for="(section, index) in sectionList"
:key="index"
:title="section.title"
:text="section.text"
:image="section.image"
:alt="section.alt"
:reverse="index % 2 !== 0"
/>
</section>
</div>
</template>
<script lang="ts">
// import SideBar from './components/organisms/SideBar.vue'
import PaddingWrapper from "../components/molecules/PaddingWrapper.vue";
import IntroSection from "../components/organisms/IntroSection.vue";
import HistorySection from "../components/organisms/HistorySection.vue";
import "../assets/style.scss";
import "bulma/css/bulma.css";
<script setup lang="ts">
import HomeSectionWrapper from '@/components/molecules/HomeSectionWrapper.vue'
import '@/assets/style.scss'
import 'bulma/css/bulma.css'
import { useI18n } from 'vue-i18n'
import type { MessageSchema } from '../i18n/types'
import { computed } from 'vue'
export default {
name: "app",
components: { PaddingWrapper, IntroSection, HistorySection },
data() {
return { sectionList: ["IntroSection", "HistorySection"] };
},
};
const { tm } = useI18n()
const sectionList = computed<MessageSchema['sections']>(() => tm('sections'))
console.log(sectionList.value)
</script>

View file

@ -10,6 +10,10 @@
"noFallthroughCasesInSwitch": true,
"noUncheckedSideEffectImports": true,
"noUncheckedIndexedAccess": true,
"baseUrl": ".",
"paths": {
"@/*": ["src/*"]
},
},
"include": [
"src/**/*.ts",

View file

@ -1,4 +1,5 @@
import { defineConfig } from "vite";
import { fileURLToPath, URL } from 'node:url'
import vue from "@vitejs/plugin-vue";
import tailwindcss from "@tailwindcss/vite";
import vueRouter from "unplugin-vue-router/vite";
@ -14,4 +15,9 @@ export default defineConfig({
outDir: "/var/www/viossa.net",
emptyOutDir: true,
},
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
}
});