I'm currently in the process of building a website with the vuesax theme and vue cli 3.0.
Custom Default Layout:
<template>
<div class="main-wrapper">
<!---Navigation-->
<Navbar
:topbarColor="topbarColor"
:logo="require('@/assets/images/logo/logo-light-icon.png')"
:title="logotitle"
/>
<!---Sidebar-->
<SideBar parent=".main-wrapper" />
<Breadcrumbs :pageTitle="pageTitle" :breadcrumbLinks=breadcrumbLinks />
<!---Page Container-->
<div class="main-container-fluid">
<slot />
</div>
</div>
</template>
Enhanced Dashboard Component:
<template>
<DefaultLayout :pageTitle="$t('dashboard.pageTitle')" :breadcrumbLinks=breadcrumbLinks>
<div>
<States />
<vs-row vs-justify="center">
<vs-col vs-lg="12">
<vs-card>
<div slot="header">
<div class="d-flex align-items-center">
<div>
<h5 class="card-title">{{ $t('dashboard.projects.recent') }}</h5>
</div>
<div class="ml-auto text-right">
<div>
<span class="text-muted">{{ $t('dashboard.projects.total') }}</span>
<h2 class="text-success mb-0">90</h2>
</div>
</div>
</div>
</div>
<RecentProjects />
</vs-card>
</vs-col>
</vs-row>
</div>
</DefaultLayout>
</template>
<script>
import DefaultLayout from "../layouts/DefaultLayout";
import RecentProjects from "../components/dashboard/RecentProjects.vue";
import States from "../components/dashboard/States.vue";
export default {
name: "Dashboard",
components: {
RecentProjects,
States,
DefaultLayout
},
data: () => ({
breadcrumbLinks: [
{
title: global.vm.$t('breadcrumbs.home'),
url: ""
},
{
title: global.vm.$t('breadcrumbs.dashboard'),
active: true
}
],
})
};
</script>
Improved Breadcrumbs Component:
<template>
<vs-row class="vs-breadcrumb-row" vs-type="flex" vs-justify="space-around">
<vs-col
type="flex"
vs-justify="center"
vs-align="center"
vs-lg="12"
vs-sm="12"
vs-xs="12"
code-toggler
>
<vs-card class="br-0">
<h4 class="card-title mb-0 d-flex">
<vs-row vs-justify="space-between" vs-align="center">
{{ pageTitle }}
<div class="d-flex align-items-center">
<vs-breadcrumb separator="chevron_right"
:items="breadcrumbLinks"
></vs-breadcrumb>
</div>
</vs-row>
</h4>
</vs-card>
</vs-col>
</vs-row>
</template>
<script>
export default {
name: "Breadcrumbs",
props: {
pageTitle: {
type: String
},
breadcrumbLinks: {
type: Array
}
}
};
</script>
I've encountered an error, which you can view here.
I've successfully implemented the vue i18n module for translation, except for one scenario: when switching from English to French, the current page's breadcrumb translation remains in English. However, it switches to French when navigating to other pages.