feat: 2.0

This commit is contained in:
mozzie 2023-02-26 20:50:50 +08:00
parent 16f602a40f
commit 782697d2f5
8 changed files with 196 additions and 22 deletions

View File

@ -10,7 +10,15 @@ export {}
declare module '@vue/runtime-core' { declare module '@vue/runtime-core' {
export interface GlobalComponents { export interface GlobalComponents {
AButton: typeof import('@arco-design/web-vue')['Button'] AButton: typeof import('@arco-design/web-vue')['Button']
ACol: typeof import('@arco-design/web-vue')['Col']
AInput: typeof import('@arco-design/web-vue')['Input']
AInputSearch: typeof import('@arco-design/web-vue')['InputSearch'] AInputSearch: typeof import('@arco-design/web-vue')['InputSearch']
ALink: typeof import('@arco-design/web-vue')['Link']
AMenu: typeof import('@arco-design/web-vue')['Menu']
AMenuItem: typeof import('@arco-design/web-vue')['MenuItem']
ARow: typeof import('@arco-design/web-vue')['Row']
ASpace: typeof import('@arco-design/web-vue')['Space']
ASubMenu: typeof import('@arco-design/web-vue')['SubMenu']
HelloWorld: typeof import('./src/components/HelloWorld.vue')['default'] HelloWorld: typeof import('./src/components/HelloWorld.vue')['default']
IconCommunity: typeof import('./src/components/icons/IconCommunity.vue')['default'] IconCommunity: typeof import('./src/components/icons/IconCommunity.vue')['default']
IconDocumentation: typeof import('./src/components/icons/IconDocumentation.vue')['default'] IconDocumentation: typeof import('./src/components/icons/IconDocumentation.vue')['default']

View File

@ -1,5 +1,11 @@
@import 'normalize.css'; @import 'normalize.css';
html,
body {
position: relative;
background: var(--color-neutral-2);
}
@font-face { @font-face {
font-family: 'bs'; font-family: 'bs';
src: url('./backset.woff'); src: url('./backset.woff');

View File

@ -1,10 +1,20 @@
<script setup lang="ts"> <script setup lang="ts">
import { RouterView } from 'vue-router'
import Nav from './Nav.vue'; import Nav from './Nav.vue';
</script> </script>
<template> <template>
<Nav /> <Nav />
<main>
<RouterView /> <RouterView />
</main>
</template> </template>
<style lang="less" scoped>
main {
position: absolute;
left: calc((100% - 1120px) / 2);
right: calc((100% - 1120px) / 2);
padding: 100px 0 40px 0;
}
</style>

View File

@ -0,0 +1,98 @@
<script lang="ts" setup>
import {
IconNotification,
IconBook,
IconMessage,
} from '@arco-design/web-vue/es/icon';
import { ref } from 'vue';
import { useRouter } from 'vue-router';
const router = useRouter()
const onMenuItemClick = (key: string) => {
console.log(key)
router.push(key)
}
</script>
<template>
<aside class="left-menu">
<a-menu auto-open showCollapseButton @menu-item-click="onMenuItemClick">
<a-menu-item key="/">
<template #icon><icon-notification /></template>
公告
</a-menu-item>
<a-menu-item key="course">
<template #icon><icon-book /></template>
课程
</a-menu-item>
<a-menu-item key="topic">
<template #icon><icon-message /></template>
讨论
</a-menu-item>
<!-- <a-sub-menu key="3">
<template #icon><icon-bulb></icon-bulb></template>
<template #title>讨论</template>
<a-menu-item key="3_0">宏观经济</a-menu-item>
<a-menu-item key="3_1">指标编写</a-menu-item>
</a-sub-menu> -->
</a-menu>
</aside>
</template>
<style lang="less" scoped>
.left-menu {
position: fixed;
left: calc((100% - 1120px) / 2);
top: 100px;
bottom: 40px;
box-sizing: border-box;
background-color: var(--color-neutral-2);
}
.left-menu .arco-menu {
width: 200px;
height: 100%;
box-shadow: 0 0 1px rgba(0, 0, 0, 0.3);
}
.left-menu .arco-menu :deep(.arco-menu-collapse-button) {
width: 32px;
height: 32px;
border-radius: 50%;
}
.left-menu .arco-menu:not(.arco-menu-collapsed) :deep(.arco-menu-collapse-button) {
right: 0;
bottom: 8px;
transform: translateX(50%);
}
.left-menu .arco-menu:not(.arco-menu-collapsed)::before {
content: '';
position: absolute;
right: 0;
bottom: 0;
width: 48px;
height: 48px;
background-color: inherit;
border-radius: 50%;
box-shadow: -4px 0 2px var(--color-bg-2), 0 0 1px rgba(0, 0, 0, 0.3);
transform: translateX(50%);
}
.left-menu .arco-menu.arco-menu-collapsed {
width: 48px;
height: auto;
padding-top: 24px;
padding-bottom: 138px;
border-radius: 22px;
}
.left-menu .arco-menu.arco-menu-collapsed :deep(.arco-menu-collapse-button) {
right: 8px;
bottom: 8px;
}
</style>

View File

@ -15,9 +15,10 @@ import Search from '@vicons/carbon/Search'
<span>Backset</span> <span>Backset</span>
</div> </div>
<div class="middle"> <div class="middle">
<div class="search"> <router-link to="course">学习</router-link>
<a-input-search :style="{ width: '320px' }" placeholder="搜索" /> <router-link to="topic">讨论</router-link>
</div> <router-link to="blog">博客</router-link>
<a-input-search :style="{ width: '160px' }" placeholder="搜索" />
</div> </div>
<div class="end"> <div class="end">
<span>注册</span> <span>注册</span>
@ -29,6 +30,10 @@ import Search from '@vicons/carbon/Search'
<style lang="less" scoped> <style lang="less" scoped>
header { header {
position: fixed;
left: 0;
right: 0;
z-index: 1994;
height: 60px; height: 60px;
background: #24292f; background: #24292f;
color: #d7d7d7; color: #d7d7d7;
@ -42,13 +47,14 @@ header {
.start { .start {
display: flex; display: flex;
align-items: center; align-items: center;
cursor: pointer;
svg { svg {
cursor: pointer;
width: 28px; width: 28px;
} }
span { span {
cursor: pointer;
padding-left: 10px; padding-left: 10px;
font-size: 20px; font-size: 20px;
font-family: 'bs'; font-family: 'bs';
@ -56,18 +62,31 @@ header {
} }
.middle { .middle {
text-align: right; display: flex;
.arco-input-search{ align-items: center;
a {
color: #d7d7d7;
text-decoration: none;
cursor: pointer;
margin-right: 30px;
&:hover {
color: #fff;
}
&.arco-input-search {
border: 0; border: 0;
} }
} }
}
.end { .end {
text-align: right; text-align: right;
span { span {
cursor: pointer; cursor: pointer;
margin-left: 30px; margin-left: 32px;
&:hover { &:hover {
color: #fff; color: #fff;

View File

@ -9,14 +9,11 @@ const router = createRouter({
name: 'home', name: 'home',
component: HomeView component: HomeView
}, },
// { {
// path: '/about', path: '/course',
// name: 'about', name: 'course',
// // route level code-splitting component: () => import('../views/Course/index.vue')
// // this generates a separate chunk (About.[hash].js) for this route }
// // which is lazy-loaded when the route is visited.
// component: () => import('../views/AboutView.vue')
// }
] ]
}) })

View File

@ -0,0 +1,5 @@
<template>
<div>
course
</div>
</template>

View File

@ -2,7 +2,38 @@
</script> </script>
<template> <template>
<main> <div>
home <h1>home</h1>
</main> <h1>home</h1>
<h1>home</h1>
<h1>home</h1>
<h1>home</h1>
<h1>home</h1>
<h1>home</h1>
<h1>home</h1>
<h1>home</h1>
<h1>home</h1>
<h1>home</h1>
<h1>home</h1>
<h1>home</h1>
<h1>home</h1>
<h1>home</h1>
<h1>home</h1>
<h1>home</h1>
<h1>home</h1>
<h1>home</h1>
<h1>home</h1>
<h1>home</h1>
<h1>home</h1>
<h1>home</h1>
<h1>home</h1>
<h1>home</h1>
<h1>home</h1>
<h1>home</h1>
<h1>home</h1>
<h1>home</h1>
<h1>home</h1>
</div>
</template> </template>
<style lang="less" scoped></style>