diff --git a/my-project-frontend/package-lock.json b/my-project-frontend/package-lock.json index e9d5b49..b80a5a4 100644 --- a/my-project-frontend/package-lock.json +++ b/my-project-frontend/package-lock.json @@ -14,6 +14,7 @@ "axios": "^1.4.0", "element-plus": "^2.3.9", "pinia": "^2.1.6", + "quill-delta-to-html": "^0.12.1", "quill-image-resize-vue": "^1.0.4", "quill-image-super-solution-module": "^2.0.1", "vue": "^3.3.4", @@ -1827,6 +1828,14 @@ "lodash.isequal": "^4.5.0" } }, + "node_modules/quill-delta-to-html": { + "version": "0.12.1", + "resolved": "https://registry.npmmirror.com/quill-delta-to-html/-/quill-delta-to-html-0.12.1.tgz", + "integrity": "sha512-QhpeMk9+5ge3HYbL5A0Ewz3pXCsbemqGvIF/kw5D6D4V68AtcUp7yt9xNUkzOk/0IQz43hKy3IkzBzRhLIE+oA==", + "dependencies": { + "lodash.isequal": "^4.5.0" + } + }, "node_modules/quill-image-resize-vue": { "version": "1.0.4", "resolved": "https://registry.npmmirror.com/quill-image-resize-vue/-/quill-image-resize-vue-1.0.4.tgz", diff --git a/my-project-frontend/package.json b/my-project-frontend/package.json index 2b169d8..8e13565 100644 --- a/my-project-frontend/package.json +++ b/my-project-frontend/package.json @@ -14,6 +14,7 @@ "axios": "^1.4.0", "element-plus": "^2.3.9", "pinia": "^2.1.6", + "quill-delta-to-html": "^0.12.1", "quill-image-resize-vue": "^1.0.4", "quill-image-super-solution-module": "^2.0.1", "vue": "^3.3.4", diff --git a/my-project-frontend/src/router/index.js b/my-project-frontend/src/router/index.js index b708215..f1871a0 100644 --- a/my-project-frontend/src/router/index.js +++ b/my-project-frontend/src/router/index.js @@ -31,11 +31,18 @@ const router = createRouter({ { path: '', name: 'topics', - component: () => import('@/views/forum/TopicList.vue') - }, { - path: 'post-detail/:tid', - name: 'post-detail', - component: () => import('@/views/forum/TopicDetail.vue') + component: () => import('@/views/forum/Forum.vue'), + children: [ + { + path: '', + name: 'topics', + component: () => import('@/views/forum/TopicList.vue') + }, { + path: 'post-detail/:tid', + name: 'post-detail', + component: () => import('@/views/forum/TopicDetail.vue') + } + ] }, { path: 'user-setting', name: 'user-setting', diff --git a/my-project-frontend/src/views/forum/Forum.vue b/my-project-frontend/src/views/forum/Forum.vue new file mode 100644 index 0000000..c53b4cb --- /dev/null +++ b/my-project-frontend/src/views/forum/Forum.vue @@ -0,0 +1,37 @@ + + + + + diff --git a/my-project-frontend/src/views/forum/TopicDetail.vue b/my-project-frontend/src/views/forum/TopicDetail.vue index 738ca03..aba0d64 100644 --- a/my-project-frontend/src/views/forum/TopicDetail.vue +++ b/my-project-frontend/src/views/forum/TopicDetail.vue @@ -1,8 +1,16 @@ @@ -27,10 +85,37 @@ get(`/api/forum/topic?tid=${tid}`, data => topic.value = data) display: flex; flex-direction: column; gap: 10px; + padding: 10px 0; } .topic-main { display: flex; border-radius: 7px; + margin: 0 auto; + background-color: var(--el-bg-color); + width: 800px; + + .topic-main-left { + width: 200px; + padding: 10px; + text-align: center; + border-right: solid 1px var(--el-border-color); + + .desc { + font-size: 13px; + color: grey; + } + } + + .topic-main-right { + width: 600px; + padding: 10px 20px; + + .topic-content { + font-size: 14px; + line-height: 22px; + opacity: 0.8; + } + } } diff --git a/my-project-frontend/src/views/forum/TopicList.vue b/my-project-frontend/src/views/forum/TopicList.vue index 8bf79fd..2ebe15b 100644 --- a/my-project-frontend/src/views/forum/TopicList.vue +++ b/my-project-frontend/src/views/forum/TopicList.vue @@ -61,12 +61,6 @@ function updateList() { topics.end = true }) } -get('/api/forum/types', data => { - const array = [] - array.push({name: '全部', id: 0, color: 'linear-gradient(45deg, white, red, orange, gold, green, blue)'}) - data.forEach(d => array.push(d)) - store.forum.types = array -}) get('/api/forum/top-topic', data => topics.top = data) function onTopicCreate() { @@ -298,15 +292,6 @@ navigator.geolocation.getCurrentPosition(position => { border-radius: 5px; } - .topic-type { - display: inline-block; - border: solid 0.5px grey; - border-radius: 5px; - font-size: 12px; - padding: 0 5px; - height: 18px; - } - .topic-preview-content { font-size: 13px; color: grey;