Compare commits

...

2 Commits

Author SHA1 Message Date
zhcnyuyang
14fa24ce3b 加入原创的404页面 2025-05-02 16:32:03 +08:00
zhcnyuyang
6601c46708 首页创建成功,路由功能可用,添加404页面。 2025-05-02 15:16:32 +08:00
8 changed files with 203 additions and 10 deletions

View File

@ -6,9 +6,14 @@ import Toolbar from './components/Toolbar.vue'
<template> <template>
<div id="contentPane"> <div id="contentPane">
<Toolbar></Toolbar> <Toolbar></Toolbar>
<div id="content"><router-view/></div> <div v-if="$route.path === '/ContactUs'">
<div id="footer"> <router-view/>
<Footer></Footer> </div>
<div v-else id="defaultcontainer">
<div id="content"><router-view/></div>
<div id="footer">
<Footer></Footer>
</div>
</div> </div>
</div> </div>
</template> </template>
@ -23,14 +28,24 @@ import Toolbar from './components/Toolbar.vue'
flex-direction: column; flex-direction: column;
min-height: 100vh; min-height: 100vh;
} }
#defaultcontainer{
display: flex;
flex-direction: column;
min-height: 100vh;
}
#content{ #content{
display: flex;
position: relative; position: relative;
flex:1; flex:1;
width: 100%; width: 100%;
min-height: 100%; min-height: 100%;
} }
@include media-breakpoint-between(xs, sm) { #footer{
margin-top: 0px;
}
@include media-breakpoint-between(xs, md) {
} }
@include media-breakpoint-between(md, xl) { @include media-breakpoint-between(md, xl) {

View File

@ -1,5 +1,12 @@
<template> <script setup>
import Footer from './Footer.vue'
</script>
<template>
<div id="contactRoot">
<div id="upbar"></div>
<Footer></Footer>
</div>
</template> </template>
<script> <script>
@ -8,6 +15,26 @@ export default {
} }
</script> </script>
<style scoped> <style lang="scss">
@import "node_modules/bootstrap/scss/_functions.scss";
@import "node_modules/bootstrap/scss/_variables.scss";
@import "node_modules/bootstrap/scss/_mixins.scss";
#upbar{
width: 100%;
@include media-breakpoint-between(xs, md) {
height: 33px;
}
@include media-breakpoint-up(md) {
height: 0px;
}
}
#contactRoot{
position: relative;
flex:1;
width: 100%;
height: 100vh;
background-color: black;
}
</style> </style>

View File

@ -86,6 +86,7 @@ export default {
#footerroot #footerroot
{ {
min-height: 759px; min-height: 759px;
margin-top: 0px;
} }
#footercontent #footercontent
{ {

View File

@ -1,5 +1,8 @@
<template> <template>
<div style="position: relative;
flex:1;width: 100%;min-height: 100%;background-color: #0dcaf0">
<h1>It works!</h1>
</div>
</template> </template>
<script> <script>

View File

@ -183,8 +183,8 @@ export default {
#toproot #toproot
{ {
display: flex; display: flex;
position: -webkit-sticky; //position: -webkit-fixed;
position: sticky; position: fixed;
top:0px; top:0px;
background-color: rgba(255,255,255,0); background-color: rgba(255,255,255,0);
z-index: 7; z-index: 7;

View File

@ -0,0 +1,101 @@
<template>
<div id="ErrRoot">
<div id="upbarErr"></div>
<div id="ErrContent">
<div>
<span class="itemtitle">404:Not Found</span>
<br/>
<span class="itemcontent">您要找的页面不存在<a href="/">返回主页</a></span>
</div>
</div>
</div>
</template>
<script>
export default {
name: "Err404"
}
</script>
<style scoped lang="scss">
@import "node_modules/bootstrap/scss/_functions.scss";
@import "node_modules/bootstrap/scss/_variables.scss";
@import "node_modules/bootstrap/scss/_mixins.scss";
#upbarErr{
position: relative;
flex:1;
width: 100%;
flex-shrink: 0;
@include media-breakpoint-between(xs, md) {
min-height: 70px!important;
}
@include media-breakpoint-up(md) {
//min-height: 95.17px!important;
min-height: 95.17px!important;
}
}
#ErrContent{
position: relative;
flex:2;
display: flex;
background-color: black;
width:100%;
align-items: center;
justify-content: center;
//height: 100%;
@include media-breakpoint-between(xs, md) {
min-height: 614px;
}
@include media-breakpoint-up(md) {
min-height: 338px;
}
}
#ErrRoot{
position: relative;
flex:1;
display: flex;
flex-direction: column;
background-color: black;
margin-top: 0px;
align-items: center;
justify-content: center;
width:100%;
min-height: 100%;
@include media-breakpoint-between(xs, md) {
//min-height:700px;
}
@include media-breakpoint-up(md) {
//min-height: 700px;
}
}
.itemtitle
{
width: 280px;
overflow-wrap: break-word;
color: rgba(255, 255, 255, 0.6);
font-size: 20px;
font-family: PingFangSC-Regular;
font-weight: normal;
text-align: left;
line-height: 30px;
display: inline-block;
}
.itemcontent
{
width: 280px;
overflow-wrap: break-word;
color: rgba(255, 255, 255, 1);
font-size: 20px;
font-family: PingFangSC-Regular;
font-weight: normal;
text-align: left;
line-height: 30px;
display: inline-block;
}
</style>

View File

@ -1,9 +1,20 @@
import { createApp } from 'vue' import { createApp } from 'vue'
import App from './App.vue' import App from './App.vue'
import router from './router.js'
// 引入Bootstrap CSS // 引入Bootstrap CSS
import 'bootstrap/dist/css/bootstrap.min.css' import 'bootstrap/dist/css/bootstrap.min.css'
// 引入Bootstrap JSbundle版本 // 引入Bootstrap JSbundle版本
import 'bootstrap/dist/js/bootstrap.bundle.min.js' import 'bootstrap/dist/js/bootstrap.bundle.min.js'
createApp(App).mount('#app') createApp(App).use(router).mount('#app')
// new Vue({
// el: '#app',
// router,
// components: { App },
// template: '<App/>'
// })
// const app = createApp(App)
// app.use(router)
// app.mount('#app')

35
src/router.js Normal file
View File

@ -0,0 +1,35 @@
import { createRouter, createWebHistory } from 'vue-router'
const routes= [
{
path: '/',
name: 'Homepage',
component: ()=>import('./components/Homepage.vue')
},
{
path: '/ContactUs',
name: 'ContactUs',
component: ()=>import('./components/ContactUs.vue')
},
{
path: '/Aboutus',
name: 'Aboutus',
component: ()=>import('./components/Aboutus.vue')
},
{
path: '/Err404',
name: 'Err404',
component: ()=>import('./components/Tools/Err404.vue')
},
{
path: '/:pathMatch(.*)*',
redirect: '/Err404'
}
]
const router = createRouter({
history: createWebHistory(),
routes
})
export default router