重构优化框架
这是一个大版本的更新 现在,框架更加稳定
This commit is contained in:
3
Yi.Vue3.x/.browserslistrc
Normal file
3
Yi.Vue3.x/.browserslistrc
Normal file
@@ -0,0 +1,3 @@
|
||||
> 1%
|
||||
last 2 versions
|
||||
not dead
|
||||
18
Yi.Vue3.x/.eslintrc.js
Normal file
18
Yi.Vue3.x/.eslintrc.js
Normal file
@@ -0,0 +1,18 @@
|
||||
module.exports = {
|
||||
root: true,
|
||||
env: {
|
||||
node: true
|
||||
},
|
||||
'extends': [
|
||||
'plugin:vue/vue3-essential',
|
||||
'eslint:recommended',
|
||||
'@vue/typescript/recommended'
|
||||
],
|
||||
parserOptions: {
|
||||
ecmaVersion: 2020
|
||||
},
|
||||
rules: {
|
||||
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
|
||||
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off'
|
||||
}
|
||||
}
|
||||
23
Yi.Vue3.x/.gitignore
vendored
Normal file
23
Yi.Vue3.x/.gitignore
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
.DS_Store
|
||||
node_modules
|
||||
/dist
|
||||
|
||||
|
||||
# local env files
|
||||
.env.local
|
||||
.env.*.local
|
||||
|
||||
# Log files
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
|
||||
# Editor directories and files
|
||||
.idea
|
||||
.vscode
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
24
Yi.Vue3.x/README.md
Normal file
24
Yi.Vue3.x/README.md
Normal file
@@ -0,0 +1,24 @@
|
||||
# my-app
|
||||
|
||||
## Project setup
|
||||
```
|
||||
npm install
|
||||
```
|
||||
|
||||
### Compiles and hot-reloads for development
|
||||
```
|
||||
npm run serve
|
||||
```
|
||||
|
||||
### Compiles and minifies for production
|
||||
```
|
||||
npm run build
|
||||
```
|
||||
|
||||
### Lints and fixes files
|
||||
```
|
||||
npm run lint
|
||||
```
|
||||
|
||||
### Customize configuration
|
||||
See [Configuration Reference](https://cli.vuejs.org/config/).
|
||||
5
Yi.Vue3.x/babel.config.js
Normal file
5
Yi.Vue3.x/babel.config.js
Normal file
@@ -0,0 +1,5 @@
|
||||
module.exports = {
|
||||
presets: [
|
||||
'@vue/cli-plugin-babel/preset'
|
||||
]
|
||||
}
|
||||
BIN
Yi.Vue3.x/public/favicon.ico
Normal file
BIN
Yi.Vue3.x/public/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.2 KiB |
17
Yi.Vue3.x/public/index.html
Normal file
17
Yi.Vue3.x/public/index.html
Normal file
@@ -0,0 +1,17 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
||||
<title><%= htmlWebpackPlugin.options.title %></title>
|
||||
</head>
|
||||
<body>
|
||||
<noscript>
|
||||
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
|
||||
</noscript>
|
||||
<div id="app"></div>
|
||||
<!-- built files will be auto injected -->
|
||||
</body>
|
||||
</html>
|
||||
16
Yi.Vue3.x/src/App.vue
Normal file
16
Yi.Vue3.x/src/App.vue
Normal 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>
|
||||
BIN
Yi.Vue3.x/src/assets/logo.png
Normal file
BIN
Yi.Vue3.x/src/assets/logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.7 KiB |
36
Yi.Vue3.x/src/components/AppFoot.vue
Normal file
36
Yi.Vue3.x/src/components/AppFoot.vue
Normal 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>
|
||||
35
Yi.Vue3.x/src/components/AppHeader.vue
Normal file
35
Yi.Vue3.x/src/components/AppHeader.vue
Normal 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>
|
||||
3
Yi.Vue3.x/src/components/AppMain.vue
Normal file
3
Yi.Vue3.x/src/components/AppMain.vue
Normal file
@@ -0,0 +1,3 @@
|
||||
<template>
|
||||
<router-view></router-view>
|
||||
</template>
|
||||
48
Yi.Vue3.x/src/components/Layout.vue
Normal file
48
Yi.Vue3.x/src/components/Layout.vue
Normal 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
12
Yi.Vue3.x/src/main.ts
Normal 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')
|
||||
30
Yi.Vue3.x/src/router/index.ts
Normal file
30
Yi.Vue3.x/src/router/index.ts
Normal 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
6
Yi.Vue3.x/src/shims-vue.d.ts
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
/* eslint-disable */
|
||||
declare module '*.vue' {
|
||||
import type { DefineComponent } from 'vue'
|
||||
const component: DefineComponent<{}, {}, any>
|
||||
export default component
|
||||
}
|
||||
12
Yi.Vue3.x/src/store/index.ts
Normal file
12
Yi.Vue3.x/src/store/index.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { createStore } from 'vuex'
|
||||
|
||||
export default createStore({
|
||||
state: {
|
||||
},
|
||||
mutations: {
|
||||
},
|
||||
actions: {
|
||||
},
|
||||
modules: {
|
||||
}
|
||||
})
|
||||
59
Yi.Vue3.x/src/views/About.vue
Normal file
59
Yi.Vue3.x/src/views/About.vue
Normal 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>
|
||||
105
Yi.Vue3.x/src/views/Index.vue
Normal file
105
Yi.Vue3.x/src/views/Index.vue
Normal 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>
|
||||
3
Yi.Vue3.x/vue.config.js
Normal file
3
Yi.Vue3.x/vue.config.js
Normal file
@@ -0,0 +1,3 @@
|
||||
module.exports = {
|
||||
lintOnSave: false
|
||||
}
|
||||
Reference in New Issue
Block a user