add breadcrumb
This commit is contained in:
1 parent
1ff6d27ab8
commit
fc378d4903
10 files changed
+52
-14
No files matched your search
@@ -0,0 +1,19 @@
|
||||
<template>
|
||||
<el-breadcrumb separator="/">
|
||||
<el-breadcrumb-item :to="{ path: '/' }">{{ $t('common.nav.home') }}</el-breadcrumb-item>
|
||||
<el-breadcrumb-item v-for="item in items" :to="{ name: item.name }">{{ item.meta.title }}</el-breadcrumb-item>
|
||||
</el-breadcrumb>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
items: this.$route.matched
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
console.log('this', this.$route);
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -7,8 +7,8 @@
|
||||
<el-row>
|
||||
<el-col>
|
||||
<el-menu :default-active="active" class="el-menu-demo" mode="horizontal" @select="onSelect">
|
||||
<el-menu-item index="home" v-t="'common.home'" v-if="false"></el-menu-item>
|
||||
<el-menu-item index="editor" v-t="'common.editor'"></el-menu-item>
|
||||
<el-menu-item index="home" v-t="'common.nav.home'" v-if="false"></el-menu-item>
|
||||
<el-menu-item index="editor" v-t="'common.nav.editor'"></el-menu-item>
|
||||
</el-menu>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import TopHeader from '@/components/common/TopHeader.vue';
|
||||
import TopHeader from './TopHeader.vue';
|
||||
import Breadcrumb from './Breadcrumb.vue';
|
||||
|
||||
export { TopHeader };
|
||||
export { TopHeader, Breadcrumb };
|
||||
@@ -1,16 +1,16 @@
|
||||
<template>
|
||||
<el-menu class="h-full">
|
||||
<el-menu-item>
|
||||
<el-icon :size="size" :color="color" class="mr-2">
|
||||
<el-icon class="mr-2">
|
||||
<document />
|
||||
</el-icon>
|
||||
<template #title>{{ $t('content.sidebar.article') }}</template>
|
||||
<template #title>{{ $t('content.nav.article') }}</template>
|
||||
</el-menu-item>
|
||||
<el-menu-item>
|
||||
<el-icon :size="size" :color="color" class="mr-2">
|
||||
<el-icon class="mr-2">
|
||||
<box />
|
||||
</el-icon>
|
||||
<template #title>{{ $t('content.sidebar.platform') }}</template>
|
||||
<template #title>{{ $t('content.nav.platform') }}</template>
|
||||
</el-menu-item>
|
||||
</el-menu>
|
||||
</template>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import button from './button';
|
||||
import message from './message';
|
||||
import nav from './nav';
|
||||
|
||||
export default {
|
||||
nav,
|
||||
button,
|
||||
message,
|
||||
home: '首页',
|
||||
editor: '编辑器'
|
||||
message
|
||||
};
|
||||
@@ -0,0 +1,5 @@
|
||||
export default {
|
||||
editor: '编辑器',
|
||||
home: '首页',
|
||||
content: '内容'
|
||||
};
|
||||
@@ -1,7 +1,7 @@
|
||||
import sidebar from './sidebar';
|
||||
import nav from './nav';
|
||||
import editor from './editor';
|
||||
|
||||
export default {
|
||||
sidebar,
|
||||
nav,
|
||||
editor
|
||||
};
|
||||
File renamed without changes.
@@ -1,14 +1,18 @@
|
||||
<template>
|
||||
<breadcrumb />
|
||||
<div id="vditor" class="vditor" />
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import Vditor from 'vditor';
|
||||
import { Breadcrumb } from '@/components/common/index';
|
||||
import { defaultOptions } from '@/settings/editor';
|
||||
import 'vditor/src/assets/scss/index.scss';
|
||||
|
||||
export default {
|
||||
components: {},
|
||||
components: {
|
||||
Breadcrumb
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
vditor: null
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
import { createRouter, createWebHistory, createWebHashHistory } from 'vue-router';
|
||||
import i18n from '../i18n';
|
||||
|
||||
const t = i18n.global.t;
|
||||
|
||||
const routes = [
|
||||
{
|
||||
@@ -9,11 +12,17 @@ const routes = [
|
||||
{
|
||||
path: '/content',
|
||||
name: 'content',
|
||||
meta: {
|
||||
title: t('common.nav.content')
|
||||
},
|
||||
component: () => import('@/layouts/Content.vue'),
|
||||
children: [
|
||||
{
|
||||
path: 'editor',
|
||||
name: 'editor',
|
||||
meta: {
|
||||
title: t('common.nav.editor')
|
||||
},
|
||||
component: () => import('@/pages/content/Editor.vue')
|
||||
}
|
||||
]
|
||||
|
||||
Reference in new issue
Block a user