Compare commits

...
5 Commits
Author SHA1 Message Date
wonder 74c9a8c983 🐛Fix: 修复首页 2025-11-18 20:04:50 +08:00
wonder 5d33d29e59 ✨Feat: 首页目录构建 2025-11-18 20:00:39 +08:00
wonder b5575b1ba6 🔄Update: 导入 Element-plus 2025-11-18 19:18:04 +08:00
wonder aa41e6345c 🔄Update: 应用路由 2025-11-18 19:10:22 +08:00
wonder b0993ebec2 🔄Update: 添加路由 2025-11-18 18:57:44 +08:00
12 changed files with 334 additions and 10 deletions
+23 -1
View File
@@ -11,7 +11,8 @@
"core-js": "^3.8.3",
"element-plus": "^2.11.8",
"plupload": "^2.3.9",
"vue": "^3.2.13"
"vue": "^3.2.13",
"vue-router": "^4.6.3"
},
"devDependencies": {
"@babel/core": "^7.12.16",
@@ -2985,6 +2986,12 @@
"dev": true,
"license": "ISC"
},
"node_modules/@vue/devtools-api": {
"version": "6.6.4",
"resolved": "https://registry.npmjs.org/@vue/devtools-api/-/devtools-api-6.6.4.tgz",
"integrity": "sha512-sGhTPMuXqZ1rVOk32RylztWkfXTRhuS7vgAKv0zjqk8gbsHkJ7xfFf+jbySxt7tWObEJwyKaHMikV/WGDiQm8g==",
"license": "MIT"
},
"node_modules/@vue/reactivity": {
"version": "3.5.24",
"resolved": "https://registry.npmmirror.com/@vue/reactivity/-/reactivity-3.5.24.tgz",
@@ -11662,6 +11669,21 @@
"url": "https://github.com/chalk/chalk?sponsor=1"
}
},
"node_modules/vue-router": {
"version": "4.6.3",
"resolved": "https://registry.npmjs.org/vue-router/-/vue-router-4.6.3.tgz",
"integrity": "sha512-ARBedLm9YlbvQomnmq91Os7ck6efydTSpRP3nuOKCvgJOHNrhRoJDSKtee8kcL1Vf7nz6U+PMBL+hTvR3bTVQg==",
"license": "MIT",
"dependencies": {
"@vue/devtools-api": "^6.6.4"
},
"funding": {
"url": "https://github.com/sponsors/posva"
},
"peerDependencies": {
"vue": "^3.5.0"
}
},
"node_modules/vue-style-loader": {
"version": "4.1.3",
"resolved": "https://registry.npmmirror.com/vue-style-loader/-/vue-style-loader-4.1.3.tgz",
+2 -1
View File
@@ -11,7 +11,8 @@
"core-js": "^3.8.3",
"element-plus": "^2.11.8",
"plupload": "^2.3.9",
"vue": "^3.2.13"
"vue": "^3.2.13",
"vue-router": "^4.6.3"
},
"devDependencies": {
"@babel/core": "^7.12.16",
+71 -7
View File
@@ -1,15 +1,58 @@
<template>
<img alt="Vue logo" src="./assets/logo.png">
<HelloWorld msg="Welcome to Your Vue.js App"/>
<div id="app">
<el-container class="my-container">
<el-header class="my-header">
<span style="color: aliceblue; font-size: x-large;">MyUploader</span>
</el-header>
<el-container>
<el-aside>
<el-menu style="height: 100%">
<el-menu-item index="singleFileUpload" @click="redirectUrl('/single-file-upload')">
<i class="el-icon-menu"></i>
<span >单文件上传</span>
</el-menu-item>
<el-menu-item index="multiFileUpload" @click="redirectUrl('/multi-file-upload')">
<i class="el-icon-menu"></i>
<span >多文件上传</span>
</el-menu-item>
<el-menu-item index="bigFileUpload" @click="redirectUrl('/big-file-upload')">
<i class="el-icon-menu"></i>
<span >大文件上传</span>
</el-menu-item>
<el-menu-item index="stopFileUpload" @click="redirectUrl('/stop-file-upload')">
<i class="el-icon-menu"></i>
<span >断点续传</span>
</el-menu-item>
<el-menu-item index="quickUpload" @click="redirectUrl('/quick-upload')">
<i class="el-icon-menu"></i>
<span >文件秒传</span>
</el-menu-item>
<el-menu-item index="pictureUpload" @click="redirectUrl('/picture-upload')">
<i class="el-icon-menu"></i>
<span >图片上传</span>
</el-menu-item>
</el-menu>
</el-aside>
<el-main class="my-main">
<router-view></router-view>
</el-main>
</el-container>
</el-container>
</div>
</template>
<script>
import HelloWorld from './components/HelloWorld.vue'
export default {
name: 'App',
components: {
HelloWorld
data () {
return {
default: this.$route.name
}
},
methods: {
redirectUrl(val) {
this.$router.push(val)
}
}
}
</script>
@@ -19,8 +62,29 @@ export default {
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
position: absolute;
text-align: center;
color: #2c3e50;
margin-top: 60px;
top: 0;
left: 0;
bottom: 0;
width: 100%;
}
.my-container {
margin: 0 auto;
position: absolute;
width: 100%;
height: 100%;
}
.my-header {
background-color: deepskyblue;
height: 20px;
font-size: large;
display: flex;
justify-content: center;
align-items: center;
}
.my-main {
margin: 1em 1em;
}
</style>
+29
View File
@@ -0,0 +1,29 @@
<template>
大文件上传
</template>
<script>
export default {
props: {
msg: String
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h3 {
margin: 40px 0 0;
}
ul {
list-style-type: none;
padding: 0;
}
li {
display: inline-block;
margin: 0 10px;
}
a {
color: #42b983;
}
</style>
+8
View File
@@ -1,4 +1,7 @@
<template>
<div>
<el-button>I am ElButton</el-button>
</div>
<div class="hello">
<h1>{{ msg }}</h1>
<p>
@@ -31,10 +34,15 @@
</template>
<script>
import { ElButton } from 'element-plus';
export default {
name: 'HelloWorld',
props: {
msg: String
},
components: {
ElButton
}
}
</script>
@@ -0,0 +1,29 @@
<template>
多文件上传
</template>
<script>
export default {
props: {
msg: String
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h3 {
margin: 40px 0 0;
}
ul {
list-style-type: none;
padding: 0;
}
li {
display: inline-block;
margin: 0 10px;
}
a {
color: #42b983;
}
</style>
+29
View File
@@ -0,0 +1,29 @@
<template>
图片上传
</template>
<script>
export default {
props: {
msg: String
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h3 {
margin: 40px 0 0;
}
ul {
list-style-type: none;
padding: 0;
}
li {
display: inline-block;
margin: 0 10px;
}
a {
color: #42b983;
}
</style>
+29
View File
@@ -0,0 +1,29 @@
<template>
文件秒传
</template>
<script>
export default {
props: {
msg: String
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h3 {
margin: 40px 0 0;
}
ul {
list-style-type: none;
padding: 0;
}
li {
display: inline-block;
margin: 0 10px;
}
a {
color: #42b983;
}
</style>
@@ -0,0 +1,29 @@
<template>
单文件上传
</template>
<script>
export default {
props: {
msg: String
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h3 {
margin: 40px 0 0;
}
ul {
list-style-type: none;
padding: 0;
}
li {
display: inline-block;
margin: 0 10px;
}
a {
color: #42b983;
}
</style>
@@ -0,0 +1,29 @@
<template>
断点续传
</template>
<script>
export default {
props: {
msg: String
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h3 {
margin: 40px 0 0;
}
ul {
list-style-type: none;
padding: 0;
}
li {
display: inline-block;
margin: 0 10px;
}
a {
color: #42b983;
}
</style>
+4 -1
View File
@@ -1,4 +1,7 @@
import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
createApp(App).mount('#app')
createApp(App).use(router).use(ElementPlus).mount('#app')
+52
View File
@@ -0,0 +1,52 @@
import { createRouter, createWebHistory } from 'vue-router'
import BigFileUpload from '@/components/BigFileUpload.vue'
import MultiFileUpload from '@/components/MultiFileUpload.vue'
import PictureUpload from '@/components/PictureUpload.vue'
import QuickUpload from '@/components/QuickUpload.vue'
import SingleFileUpload from '@/components/SingleFileUpload.vue'
import StopFileUpload from '@/components/StopFileUpload.vue'
const routes = [
{
path: '/',
name: 'SingleFileUpload',
component: SingleFileUpload
},
{
path: '/big-file-upload',
name: 'BigFileUpload',
component: BigFileUpload
},
{
path: '/multi-file-upload',
name: 'MultiFileUpload',
component: MultiFileUpload
},
{
path: '/picture-upload',
name: 'PictureUpload',
component: PictureUpload
},
{
path: '/quick-upload',
name: 'QuickUpload',
component: QuickUpload
},
{
path: '/single-file-upload',
name: 'SingleFileUpload',
component: SingleFileUpload
},
{
path: '/stop-file-upload',
name: 'StopFileUpload',
component: StopFileUpload
}
]
const router = createRouter({
history: createWebHistory(),
routes
})
export default router