add 2 layer route
This commit is contained in:
1 parent
df9ac27be6
commit
9091f41012
10 files changed
+32
-23
No files matched your search
@@ -0,0 +1,9 @@
|
||||
html,
|
||||
body {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
File renamed without changes.
@@ -0,0 +1,2 @@
|
||||
@import './tailwind';
|
||||
@import './common';
|
||||
@@ -4,8 +4,9 @@
|
||||
<top-header />
|
||||
</el-header>
|
||||
<el-container>
|
||||
<el-aside width="200px"> side</el-aside>
|
||||
<el-main>
|
||||
<slot name="main"></slot>
|
||||
<router-view />
|
||||
</el-main>
|
||||
</el-container>
|
||||
</el-container>
|
||||
@@ -5,9 +5,7 @@
|
||||
</el-header>
|
||||
<el-container>
|
||||
<el-aside width="200px"> side</el-aside>
|
||||
<el-main>
|
||||
<slot name="main"></slot>
|
||||
</el-main>
|
||||
<el-main> <router-view/ > </el-main>
|
||||
</el-container>
|
||||
</el-container>
|
||||
</template>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import LayoutHome from '@/layouts/Home.vue';
|
||||
import LayoutEditor from '@/layouts/Editor.vue';
|
||||
import LayoutEditor from '@/layouts/Content.vue';
|
||||
|
||||
export { LayoutHome, LayoutEditor };
|
||||
+1
-1
@@ -4,7 +4,7 @@ import router from './router/index';
|
||||
import store from './store/index';
|
||||
import ElementPlus from 'element-plus';
|
||||
import i18n from './i18n/index';
|
||||
import './style.css';
|
||||
import './assets/scss/style.scss';
|
||||
import 'element-plus/dist/index.css';
|
||||
|
||||
createApp(App).use(router).use(store).use(ElementPlus).use(i18n).mount('#app');
|
||||
+1
-3
@@ -1,7 +1,5 @@
|
||||
<template>
|
||||
<layout-home>
|
||||
<template v-slot:main>555</template>
|
||||
</layout-home>
|
||||
<div>Home</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
|
||||
@@ -1,21 +1,14 @@
|
||||
<template>
|
||||
<layout-editor>
|
||||
<template v-slot:main>
|
||||
<div id="vditor" class="vditor" />
|
||||
</template>
|
||||
</layout-editor>
|
||||
<div id="vditor" class="vditor" />
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { LayoutEditor } from '@/layouts/index';
|
||||
import Vditor from 'vditor';
|
||||
import { defaultOptions } from '@/settings/editor';
|
||||
import 'vditor/src/assets/scss/index.scss';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
LayoutEditor
|
||||
},
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
vditor: null
|
||||
+13
-5
@@ -1,4 +1,4 @@
|
||||
import { createRouter, createWebHistory } from 'vue-router';
|
||||
import { createRouter, createWebHistory, createWebHashHistory } from 'vue-router';
|
||||
|
||||
const routes = [
|
||||
{
|
||||
@@ -7,14 +7,22 @@ const routes = [
|
||||
component: () => import('@/pages/Home.vue')
|
||||
},
|
||||
{
|
||||
path: '/editor',
|
||||
name: 'editor',
|
||||
component: () => import('@/pages/Editor.vue')
|
||||
path: '/content',
|
||||
name: 'content',
|
||||
component: () => import('@/layouts/Content.vue'),
|
||||
children: [
|
||||
{
|
||||
path: 'editor',
|
||||
name: 'editor',
|
||||
component: () => import('@/pages/content/Editor.vue')
|
||||
}
|
||||
]
|
||||
}
|
||||
];
|
||||
|
||||
const router = createRouter({
|
||||
history: createWebHistory(),
|
||||
// history: createWebHistory(),
|
||||
history: createWebHashHistory(),
|
||||
routes
|
||||
});
|
||||
export default router;
|
||||
Reference in new issue
Block a user