课堂前端代码提交

This commit is contained in:
hezi66677 2024-11-09 23:01:56 +08:00
commit 7feb8870d6
20 changed files with 1930 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/node_modules

13
index.html Normal file
View File

@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en" class="dark">
<head>
<meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite App</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.js"></script>
</body>
</html>

1674
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

20
package.json Normal file
View File

@ -0,0 +1,20 @@
{
"name": "vue3_cli_default",
"version": "0.0.0",
"scripts": {
"dev": "vite",
"build": "vite build",
"serve": "vite preview"
},
"dependencies": {
"axios": "^1.7.7",
"element-plus": "^2.8.6",
"vue": "^3.2.8",
"vue-router": "^4.4.5"
},
"devDependencies": {
"@vitejs/plugin-vue": "^1.6.0",
"@vue/compiler-sfc": "^3.2.6",
"vite": "^2.5.2"
}
}

BIN
public/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

27
src/App.vue Normal file
View File

@ -0,0 +1,27 @@
<script setup>
import {ref,onMounted,reactive} from 'vue'
import Left from './components/Left.vue'
import Right from './components/Right.vue'
import Top from './components/Top.vue'
import Botton from './components/Botton.vue'
</script>
<template>
<Top style="height: 120px;background-color: antiquewhite ; margin: 0px;"></Top>
<el-row>
<el-col :span="8">
<Left style="height: 400px; background-color: aquamarine; margin: 0px;"></Left>
</el-col>
<el-col :span="16">
<router-view style="height: 400px;background-color: beige; margin: 0px;">
</router-view>
</el-col>
</el-row>
<Botton style="height: 120px;background-color: antiquewhite;margin: 0px;"></Botton>
</template>
<style>
</style>

BIN
src/assets/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

View File

@ -0,0 +1,9 @@
<template>
<h1>botton</h1>
</template>
<script>
</script>
<style>
</style>

View File

@ -0,0 +1,9 @@
<template>
<h1>课堂管理</h1>
</template>
<script>
</script>
<style>
</style>

9
src/components/Exam.vue Normal file
View File

@ -0,0 +1,9 @@
<template>
<h1>考试测验</h1>
</template>
<script>
</script>
<style>
</style>

View File

@ -0,0 +1,38 @@
<script setup>
import { ref } from 'vue'
defineProps({
msg: String
})
const count = ref(0)
</script>
<template>
<h1>{{ msg }}</h1>
<p>
Welcome:
<a href="https://hx.dcloud.net.cn/" target="_blank">HBuilderX</a>
</p>
<p>
<a href="https://vitejs.dev/guide/features.html" target="_blank">
Vite Documentation
</a>
|
<a href="https://v3.vuejs.org/" target="_blank">Vue 3 Documentation</a>
</p>
<button type="button" @click="count++">count is: {{ count }}</button>
<p>
Edit
<code>components/HelloWorld.vue</code> to test hot module replacement.
</p>
</template>
<style scoped>
a {
color: #42b983;
}
</style>

25
src/components/Left.vue Normal file
View File

@ -0,0 +1,25 @@
<template>
<div>
<router-link to="/course">课程管理</router-link> <br />
<router-link to="/task">作业管理</router-link> <br />
<router-link to="/user">用户管理</router-link><br />
<el-button @click="myclick">代码跳转</el-button>
</div>
</template>
<script setup>
import {
useRouter
} from 'vue-router';
const router = useRouter()
function myclick() {
router.replace('/user')
}
</script>
<style>
</style>

View File

@ -0,0 +1,9 @@
<template>
<h1>作业测验</h1>
</template>
<script>
</script>
<style>
</style>

9
src/components/Right.vue Normal file
View File

@ -0,0 +1,9 @@
<template>
<h1>右边</h1>
</template>
<script>
</script>
<style>
</style>

13
src/components/Task.vue Normal file
View File

@ -0,0 +1,13 @@
<template>
<div>
<router-link to="/task/mytask">作业测验</router-link>|
<router-link to="/task/exam">考试测验</router-link>
<router-view></router-view>
</div>
</template>
<script>
</script>
<style>
</style>

9
src/components/Top.vue Normal file
View File

@ -0,0 +1,9 @@
<template>
<h1>top</h1>
</template>
<script>
</script>
<style>
</style>

9
src/components/User.vue Normal file
View File

@ -0,0 +1,9 @@
<template>
<h1>用户管理</h1>
</template>
<script>
</script>
<style>
</style>

12
src/main.js 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/router.js'
const app = createApp(App)
app.use(ElementPlus)
app.use(router)
app.mount('#app')

37
src/router/router.js Normal file
View File

@ -0,0 +1,37 @@
import {
createRouter,
createWebHashHistory
} from 'vue-router';
import Course from '../components/Course.vue'
import Task from '../components/Task.vue'
import User from '../components/User.vue'
import MyTask from '../components/MyTask.vue'
import Exam from '../components/Exam.vue'
const routes = [
{
path: '/course',
component: Course
}, {
path: '/task',
component: Task,
children: [{
path: 'mytask',
component: MyTask
},{
path: 'exam',
component: Exam
}
]
}, {
path: '/user',
component: User
}
];
const router = createRouter({
history: createWebHashHistory(),
routes
});
export default router;

7
vite.config.js Normal file
View File

@ -0,0 +1,7 @@
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue()]
})