From bd6d4cf797b7f5205b1ea4a3a8dd47f43ceaedde Mon Sep 17 00:00:00 2001 From: cast1e Date: Tue, 7 Nov 2023 22:07:15 +0800 Subject: [PATCH] Add more route --- src/components/Editor.vue | 411 ------------------------------ src/components/Home.vue | 2 +- src/components/Manage.vue | 32 +++ src/components/Recite.vue | 36 ++- src/components/manage/Editor.vue | 218 ++++++++++++++++ src/components/manage/NewSet.vue | 66 +++++ src/components/manage/SetList.vue | 186 ++++++++++++++ src/router.js | 16 +- vue.config.js | 6 +- 9 files changed, 550 insertions(+), 423 deletions(-) delete mode 100644 src/components/Editor.vue create mode 100644 src/components/Manage.vue create mode 100644 src/components/manage/Editor.vue create mode 100644 src/components/manage/NewSet.vue create mode 100644 src/components/manage/SetList.vue diff --git a/src/components/Editor.vue b/src/components/Editor.vue deleted file mode 100644 index 73b6b37..0000000 --- a/src/components/Editor.vue +++ /dev/null @@ -1,411 +0,0 @@ - - - - - diff --git a/src/components/Home.vue b/src/components/Home.vue index d41df5d..2ecf4e6 100644 --- a/src/components/Home.vue +++ b/src/components/Home.vue @@ -7,7 +7,7 @@ 背诵 - + 编辑单词本 diff --git a/src/components/Manage.vue b/src/components/Manage.vue new file mode 100644 index 0000000..7942317 --- /dev/null +++ b/src/components/Manage.vue @@ -0,0 +1,32 @@ + + + + + diff --git a/src/components/Recite.vue b/src/components/Recite.vue index 3f6eea2..7190646 100644 --- a/src/components/Recite.vue +++ b/src/components/Recite.vue @@ -4,8 +4,8 @@ 背诵 -
-
+
+
选择测验范围:
全选 @@ -22,7 +22,7 @@ 开始背诵
-
+
继续上一次的背诵
开始背诵
@@ -40,9 +40,10 @@ 上一个 下一个 显示答案 + 跳过 停止背诵 - +

{{ word.type }} {{ word.trans }}
@@ -187,6 +188,16 @@ export default { this.show(); }); }, + skip() { + ElMessage({ + message: "已经跳过该词", + type: "info" + }); + this.answered++; + localStorage.setItem("lastcurrent", this.answered.toString()); + this.next(); + return; + }, prev() { this.current--; this.show(); @@ -215,7 +226,7 @@ export default { type: "success" }); this.answered++; - localStorage.setItem("lastcurrent",this.answered.toString()); + localStorage.setItem("lastcurrent", this.answered.toString()); this.next(); return; } @@ -340,4 +351,17 @@ export default { width: 30%; min-width: 200px; } + +#lastrecite { + max-height: 150px; +} + +#range { + max-height: 85%; +} + +#rangeselect { + max-height: 100%; + overflow-x: auto; +} \ No newline at end of file diff --git a/src/components/manage/Editor.vue b/src/components/manage/Editor.vue new file mode 100644 index 0000000..c483be3 --- /dev/null +++ b/src/components/manage/Editor.vue @@ -0,0 +1,218 @@ + + + + + \ No newline at end of file diff --git a/src/components/manage/NewSet.vue b/src/components/manage/NewSet.vue new file mode 100644 index 0000000..e0e3065 --- /dev/null +++ b/src/components/manage/NewSet.vue @@ -0,0 +1,66 @@ + + + + + \ No newline at end of file diff --git a/src/components/manage/SetList.vue b/src/components/manage/SetList.vue new file mode 100644 index 0000000..307ee3b --- /dev/null +++ b/src/components/manage/SetList.vue @@ -0,0 +1,186 @@ + + + + + \ No newline at end of file diff --git a/src/router.js b/src/router.js index 3dbdfee..107d0ee 100644 --- a/src/router.js +++ b/src/router.js @@ -1,12 +1,20 @@ import {createRouter,createWebHashHistory} from 'vue-router' -import editor from './components/Editor.vue' -import recite from './components/Recite.vue' -import home from "./components/Home.vue" +const manage = ()=>import('./components/Manage.vue'); +const editor = ()=>import('./components/manage/Editor.vue'); +const home = ()=>import("./components/Home.vue"); +const recite = ()=>import('./components/Recite.vue'); +const setlist = ()=>import('./components/manage/SetList.vue'); +const newset = ()=>import('./components/manage/NewSet.vue'); const routes = [ { path: '/', component: home }, { path: '/recite', component: recite }, - { path: '/editor', component: editor }, + { path: '/manage', component: manage, + children:[ + {path: '',component:setlist}, + {path: 'new',component:newset}, + {path: 'edit',component:editor} + ]}, ] export default createRouter({ diff --git a/vue.config.js b/vue.config.js index 910e297..e012cb7 100644 --- a/vue.config.js +++ b/vue.config.js @@ -1,4 +1,8 @@ const { defineConfig } = require('@vue/cli-service') module.exports = defineConfig({ - transpileDependencies: true + transpileDependencies: true, + publicPath:"./", + devServer: { + proxy: 'http://localhost:3000' + } })