From f905b3e5d8f850baedfe7c3f83268d4ef637b69c Mon Sep 17 00:00:00 2001
From: Tim <135014430+nagisa77@users.noreply.github.com>
Date: Fri, 4 Jul 2025 17:08:28 +0800
Subject: [PATCH] Add category and tag selection to new post page
---
open-isle-cli/src/views/NewPostPageView.vue | 50 ++++++++++++++++++++-
1 file changed, 49 insertions(+), 1 deletion(-)
diff --git a/open-isle-cli/src/views/NewPostPageView.vue b/open-isle-cli/src/views/NewPostPageView.vue
index 220451793..c0ed1c8d9 100644
--- a/open-isle-cli/src/views/NewPostPageView.vue
+++ b/open-isle-cli/src/views/NewPostPageView.vue
@@ -5,6 +5,17 @@
+
+
+
+
+
+
发布
@@ -20,12 +31,25 @@ export default {
setup() {
const title = ref('')
const content = ref('')
+ const categories = ref([
+ { id: 1, name: '闲聊' },
+ { id: 2, name: '技术' }
+ ])
+ const tags = ref([
+ { id: 1, name: 'Java' },
+ { id: 2, name: 'Python' },
+ { id: 3, name: 'AI' }
+ ])
+ const selectedCategory = ref('')
+ const selectedTags = ref([])
const submitPost = () => {
console.log('title:', title.value)
console.log('content:', content.value)
+ console.log('category:', selectedCategory.value)
+ console.log('tags:', selectedTags.value)
// 在此处可以调用接口提交帖子
}
- return { title, content, submitPost }
+ return { title, content, categories, tags, selectedCategory, selectedTags, submitPost }
}
}
@@ -65,5 +89,29 @@ export default {
.post-submit:hover {
background-color: var(--primary-color-hover);
}
+
+.post-options {
+ margin-top: 20px;
+ display: flex;
+ flex-direction: column;
+ gap: 10px;
+}
+
+.category-select {
+ padding: 5px 10px;
+ border-radius: 5px;
+}
+
+.tag-select {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 10px;
+}
+
+.tag-item {
+ display: flex;
+ align-items: center;
+ gap: 4px;
+}