From ff1fdabed269ea4a0beeb22b02e2f09bf2d5d544 Mon Sep 17 00:00:00 2001 From: Xubx <1827135378@qq.com> Date: Fri, 1 Nov 2024 16:15:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=9A=E5=AE=A2=E5=8F=91=E5=B8=83=E4=B8=AD?= =?UTF-8?q?=EF=BC=8C=E6=96=B0=E5=A2=9E=E5=88=86=E7=B1=BB=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E5=92=8C=E5=B0=81=E9=9D=A2=E4=B8=8A=E4=BC=A0=EF=BC=8C=E6=8E=A5?= =?UTF-8?q?=E5=85=A5=E4=B8=83=E7=89=9B=E4=BA=91=E5=AD=98=E5=82=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Menu.vue | 21 +++-- src/config/ImageUrl.js | 2 + src/views/BlogAddView.vue | 178 ++++++++++++++++++++++++++++++++++--- src/views/BlogHomeView.vue | 19 ++-- 4 files changed, 193 insertions(+), 27 deletions(-) create mode 100644 src/config/ImageUrl.js diff --git a/src/components/Menu.vue b/src/components/Menu.vue index 488cd43..d65d93b 100644 --- a/src/components/Menu.vue +++ b/src/components/Menu.vue @@ -22,11 +22,13 @@
- + - - + + + +

{{ this.username }}

@@ -36,8 +38,9 @@ - + 更换头像 @@ -56,6 +59,12 @@
+ + + 发布 + +
-
+
- +
-
+
@@ -17,10 +17,54 @@ + + + + +

+ * + 文章分类 +

+
+ + + + + {{ tag.name }} + + + 添加文章标签 + +
+ + {{ tags.find(t => t.id === selectedTag).name }} + +
+
+
+ + +

+ 添加封面 +

+
+ + + + + + +
+
+
立即发布 - +
@@ -32,11 +76,11 @@ \ No newline at end of file diff --git a/src/views/BlogHomeView.vue b/src/views/BlogHomeView.vue index 9ac47f6..0f31041 100644 --- a/src/views/BlogHomeView.vue +++ b/src/views/BlogHomeView.vue @@ -8,16 +8,17 @@
+ :model="['Potion-Maker/Pio', 'school-2017-costume-yellow']" :direction="direction" + :size="size">
- - - + + @@ -55,6 +56,8 @@ import Footer from "../components/Footer"; // 在组件中引入 import live2d from 'vue-live2d' import { startSakura } from "../js/Sakura" +import { IMAGE_BASE_URL } from "../config/ImageUrl"; + export default { components: { HomeHeader, @@ -117,8 +120,8 @@ export default { axios.get("/blog/getBlogs").then((response) => { that.blogs = response.data; for (let index in that.blogs) { - that.blogs[index].imageUrl = this.imageUrls[index % 8]; - console.log(that.blogs[index].imageUrl); + that.blogs[index].coverImage = IMAGE_BASE_URL + that.blogs[index].coverImage; + console.log(that.blogs[index].coverImage); } that.total = that.blogs.length; //总博客数 that.handleCurrentChange(that.currentPage); //初始化当前页 @@ -128,10 +131,8 @@ export default { const startIndex = (page - 1) * this.pageSize; //当前页的起始索引 const endIndex = startIndex + this.pageSize; //当前页的结束索引 this.pagedBlogs = this.blogs.slice(startIndex, endIndex); //通过分割获取当前页的数据 - - }, - + show() { !function () { function n(n, e, t) {