重构优化框架

这是一个大版本的更新
现在,框架更加稳定
This commit is contained in:
橙子
2022-02-21 15:00:15 +08:00
parent 769cf2285a
commit 8d90abd22e
146 changed files with 801 additions and 15635 deletions

16
Yi.Vue3.x/src/App.vue Normal file
View File

@@ -0,0 +1,16 @@
<template>
<router-view/>
</template>
<style lang="scss">
body{
margin: 0;
}
#app {
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
}
</style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

View File

@@ -0,0 +1,36 @@
<template >
<div >
<div>
<span>
<el-icon :size="14"> <edit /> </el-icon>支持项目</span
>
<span>
<el-icon :size="14"> <edit /> </el-icon>联系作者</span
>
<span>
<el-icon :size="14"> <edit /> </el-icon>免责声明</span
>
</div>
<div class="el-footer"> <span>
<el-icon :size="14"> <edit /> </el-icon>免责声明</span
></div>
</div>
</template>
<script setup >
import { Edit } from "@element-plus/icons-vue";
</script>
<style scoped>
.el-icon{
margin-right: 4px;
}
span{
margin-right: 40px;
}
.el-footer {
background-color: #F0F2F5;
line-height: 60px;
}
</style>

View File

@@ -0,0 +1,35 @@
<template>
<el-menu
:default-active="activeIndex"
class="el-menu-demo"
mode="horizontal"
@select="handleSelect"
>
<el-menu-item index="1">Processing Center</el-menu-item>
<el-sub-menu index="2">
<template #title>Workspace</template>
<el-menu-item index="2-1">item one</el-menu-item>
<el-menu-item index="2-2">item two</el-menu-item>
<el-menu-item index="2-3">item three</el-menu-item>
<el-sub-menu index="2-4">
<template #title>item four</template>
<el-menu-item index="2-4-1">item one</el-menu-item>
<el-menu-item index="2-4-2">item two</el-menu-item>
<el-menu-item index="2-4-3">item three</el-menu-item>
</el-sub-menu>
</el-sub-menu>
<el-menu-item index="3" disabled>Info</el-menu-item>
<el-menu-item index="4">Orders</el-menu-item>
</el-menu>
</template>
<script lang="ts" setup>
import { ref } from 'vue'
const activeIndex = ref('1')
const activeIndex2 = ref('1')
const handleSelect = (key: string, keyPath: string[]) => {
console.log(key, keyPath)
}
</script>

View File

@@ -0,0 +1,3 @@
<template>
<router-view></router-view>
</template>

View File

@@ -0,0 +1,48 @@
<template>
<div class="common-layout">
<el-container>
<el-header> <AppHeader></AppHeader></el-header>
<el-main > <AppMain></AppMain></el-main>
<el-footer> <AppFoot></AppFoot></el-footer>
</el-container>
</div>
</template>
<script lang="ts" setup>
import AppHeader from "./AppHeader.vue";
import AppFoot from "./AppFoot.vue";
import AppMain from "./AppMain.vue";
</script>
<style lang="scss" scope>
.common-layout {
.el-header,
.el-footer {
background-color: #b3c0d1;
color: var(--el-text-color-primary);
text-align: center;
line-height: 60px;
padding: 0;
}
.el-footer {
background-color: #F0F2F5;
line-height: 60px;
}
.el-main {
background-color: #F0F2F5;
color: var(--el-text-color-primary);
text-align: center;
padding: 25px;
}
body > .el-container {
margin-bottom: 40px;
}
}
</style>

12
Yi.Vue3.x/src/main.ts Normal file
View File

@@ -0,0 +1,12 @@
import { createApp } from 'vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import App from './App.vue'
import router from './router'
import store from './store'
const app = createApp(App)
app.use(store)
app.use(router)
app.use(ElementPlus)
app.mount('#app')

View File

@@ -0,0 +1,30 @@
import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'
const routes: Array<RouteRecordRaw> = [
{
path: '/',
name: 'Layout',
component: () => import(/* webpackChunkName: "about" */ '../components/Layout.vue'),
redirect: "/index",
children: [{
path: "/index",
name: "Index",
component: () => import(/* webpackChunkName: "about" */ '../views/Index.vue')
}]
},
{
path: '/about',
name: 'About',
// route level code-splitting
// this generates a separate chunk (about.[hash].js) for this route
// which is lazy-loaded when the route is visited.
component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
}
]
const router = createRouter({
history: createWebHistory(process.env.BASE_URL),
routes
})
export default router

6
Yi.Vue3.x/src/shims-vue.d.ts vendored Normal file
View File

@@ -0,0 +1,6 @@
/* eslint-disable */
declare module '*.vue' {
import type { DefineComponent } from 'vue'
const component: DefineComponent<{}, {}, any>
export default component
}

View File

@@ -0,0 +1,12 @@
import { createStore } from 'vuex'
export default createStore({
state: {
},
mutations: {
},
actions: {
},
modules: {
}
})

View File

@@ -0,0 +1,59 @@
<template>
<el-menu
:default-active="activeIndex"
class="el-menu-demo"
mode="horizontal"
@select="handleSelect"
>
<el-menu-item index="1">Processing Center</el-menu-item>
<el-sub-menu index="2">
<template #title>Workspace</template>
<el-menu-item index="2-1">item one</el-menu-item>
<el-menu-item index="2-2">item two</el-menu-item>
<el-menu-item index="2-3">item three</el-menu-item>
<el-sub-menu index="2-4">
<template #title>item four</template>
<el-menu-item index="2-4-1">item one</el-menu-item>
<el-menu-item index="2-4-2">item two</el-menu-item>
<el-menu-item index="2-4-3">item three</el-menu-item>
</el-sub-menu>
</el-sub-menu>
<el-menu-item index="3" disabled>Info</el-menu-item>
<el-menu-item index="4">Orders</el-menu-item>
</el-menu>
<div class="h-6"></div>
<el-menu
:default-active="activeIndex2"
class="el-menu-demo"
mode="horizontal"
background-color="#545c64"
text-color="#fff"
active-text-color="#ffd04b"
@select="handleSelect"
>
<el-menu-item index="1">Processing Center</el-menu-item>
<el-sub-menu index="2">
<template #title>Workspace</template>
<el-menu-item index="2-1">item one</el-menu-item>
<el-menu-item index="2-2">item two</el-menu-item>
<el-menu-item index="2-3">item three</el-menu-item>
<el-sub-menu index="2-4">
<template #title>item four</template>
<el-menu-item index="2-4-1">item one</el-menu-item>
<el-menu-item index="2-4-2">item two</el-menu-item>
<el-menu-item index="2-4-3">item three</el-menu-item>
</el-sub-menu>
</el-sub-menu>
<el-menu-item index="3" disabled>Info</el-menu-item>
<el-menu-item index="4">Orders</el-menu-item>
</el-menu>
</template>
<script lang="ts" setup>
import { ref } from 'vue';
const activeIndex = ref('1')
const activeIndex2 = ref('1')
const handleSelect = (key: string, keyPath: string[]) => {
console.log(key, keyPath)
}
</script>

View File

@@ -0,0 +1,105 @@
<template>
<el-row>
<el-col :span="18">
<el-row>
<el-col v-for="index of 11" :key="index" :span="2"><div class="head-1">999</div></el-col>
<el-col :span="2"><div class="head-1-right"> <el-button type="primary">设置标签</el-button></div></el-col>
</el-row>
<el-row>
<el-col :span="24"><div class="head-2">000</div></el-col>
</el-row>
<el-row v-for="index of 4" :key="index" >
<el-col :span="8"
><div class="bg-white grid-content">666</div></el-col
>
<el-col :span="8"
><div class="bg-white grid-content">777</div></el-col
>
<el-col :span="8"
><div class="bg-white grid-content">888</div>
</el-col>
</el-row>
<el-row >
<el-col :span="24"
><div ><el-button size="large" type="primary" class="foot-button">点击查看更多</el-button></div></el-col
>
</el-row>
</el-col>
<el-col :span="6">
<el-row>
<el-col :span="24"
><div class="bg-white right-1">111</div></el-col
>
</el-row>
<el-row>
<el-col :span="24"
><div class="bg-white right-2">222</div></el-col
>
</el-row>
<el-row>
<el-col :span="24"
><div class="bg-white right-3">333</div></el-col
>
</el-row>
</el-col>
</el-row>
</template>
<script lang="ts">
</script>
<style scoped>
.head-1 {
height: 30px;
padding: 8px 8px 4px 8px;
background: #ffffff;
}
.head-1-right{
padding: 5px 0 0 0;
}
.foot-button{
margin-top: 50px;
}
.head-2 {
height: 40px;
padding: 16px 24px 16px 24px;
text-align: left;
background: #ffffff;
}
.right-1{
min-height: 165px;
}
.right-2{
min-height: 467px;
}
.right-3{
min-height: 111px;
}
.bg-white {
background: #ffffff;
}
.el-row {
margin-bottom: 10px;
}
.el-col {
border-radius: 4px;
padding-left: 8px;
padding-right: 8px;
}
.grid-content {
border-radius: 4px;
height: 256px;
}
</style>