From 66854e6bf2a9ea0ec0de143751d506a661c18524 Mon Sep 17 00:00:00 2001 From: Ryan Wang Date: Tue, 10 May 2022 18:06:47 +0800 Subject: [PATCH] feat: add posts mock data Signed-off-by: Ryan Wang --- src/core/icons.ts | 3 + src/views/posts/PostList.vue | 157 ++++- src/views/posts/posts-mock.ts | 1035 +++++++++++++++++++++++++++++++++ src/views/users/Profile.vue | 14 +- 4 files changed, 1182 insertions(+), 27 deletions(-) create mode 100644 src/views/posts/posts-mock.ts diff --git a/src/core/icons.ts b/src/core/icons.ts index 3c8ff624..5aaa3594 100644 --- a/src/core/icons.ts +++ b/src/core/icons.ts @@ -36,6 +36,8 @@ import IconCheckboxCircle from "~icons/ri/checkbox-circle-line"; import IconInformation from "~icons/ri/information-line"; // @ts-ignore import IconCloseCircle from "~icons/ri/close-circle-line"; +// @ts-ignore +import IconDeleteBin from "~icons/ri/delete-bin-2-line"; export { IconDashboard, @@ -57,4 +59,5 @@ export { IconCheckboxCircle, IconInformation, IconCloseCircle, + IconDeleteBin, }; diff --git a/src/views/posts/PostList.vue b/src/views/posts/PostList.vue index 77a53043..3d9736e0 100644 --- a/src/views/posts/PostList.vue +++ b/src/views/posts/PostList.vue @@ -3,6 +3,25 @@ import FilledLayout from "@/layouts/FilledLayout.vue"; import { VButton } from "@/components/base/button"; import { VTag } from "@/components/base/tag"; import { IconBookRead } from "@/core/icons"; +import { posts } from "./posts-mock"; +import { ref } from "vue"; + +const postsRef = ref( + posts.map((item) => { + return { + ...item, + checked: false, + }; + }) +); + +const checkAll = ref(false); + +const handleCheckAll = () => { + postsRef.value.forEach((item) => { + item.checked = checkAll.value; + }); +};