Skip to content

Commit d252a48

Browse files
committed
feat: 添加删除动画
1 parent cab2d57 commit d252a48

File tree

5 files changed

+14
-6
lines changed

5 files changed

+14
-6
lines changed

backend/src/extensions/documentation/documentation/1.0.0/full_documentation.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"name": "Apache 2.0",
1515
"url": "https://www.apache.org/licenses/LICENSE-2.0.html"
1616
},
17-
"x-generation-date": "2023-02-07T11:00:32.258Z"
17+
"x-generation-date": "2023-02-07T14:16:36.493Z"
1818
},
1919
"x-strapi-config": {
2020
"path": "/documentation",

frontend/components/ArticlesList/Item/index.vue

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
<script setup lang="ts">
2+
import { useAutoAnimate } from '@formkit/auto-animate/vue'
23
import type { Ref } from 'vue'
34
import type { IArticleItem } from '~~/types/IArticleItem'
45
const artlist = inject<Ref<IArticleItem[]>>('artlist')
6+
const [parent] = useAutoAnimate()
57
const hideHandler = (id: string) => {
68
artlist && (artlist.value = artlist.value.filter(item => item.id !== id))
79
}
810
</script>
911

1012
<template>
11-
<ClientOnly>
13+
<ul ref="parent">
14+
<ArticlesListItemAds />
1215
<li v-for="art in artlist" :key="art.id" class="list_container">
1316
<ArticlesListUiLink :to="`/article/${art.id}`">
1417
<div class="left">
@@ -24,7 +27,7 @@ const hideHandler = (id: string) => {
2427
</ArticlesListUiLink>
2528
<div class="icon" @click="hideHandler(art.id)" />
2629
</li>
27-
</ClientOnly>
30+
</ul>
2831
</template>
2932

3033
<style scoped>

frontend/components/ArticlesList/index.vue

+2-3
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,8 @@ onUnmounted(() => {
3232
<div class="bg-jj-article">
3333
<ArticlesListNavigation />
3434
<ArticlesListUiSkeleton v-if="isLoading || !artlist.length" />
35-
<ul v-else>
36-
<ArticlesListItemAds />
35+
<ClientOnly v-else>
3736
<ArticlesListItem />
38-
</ul>
37+
</ClientOnly>
3938
</div>
4039
</template>

frontend/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
"@types/marked": "^4.0.8",
4242
"@unocss/nuxt": "^0.46.5",
4343
"@vueuse/nuxt": "^9.5.0",
44+
"@formkit/auto-animate": "^1.0.0-beta.6",
4445
"eslint": "^8.27.0",
4546
"husky": "^8.0.3",
4647
"lint-staged": "^13.1.0",

yarn.lock

+5
Original file line numberDiff line numberDiff line change
@@ -1970,6 +1970,11 @@
19701970
intl-messageformat "9.13.0"
19711971
tslib "^2.1.0"
19721972

1973+
"@formkit/auto-animate@^1.0.0-beta.6":
1974+
version "1.0.0-beta.6"
1975+
resolved "https://registry.npmmirror.com/@formkit/auto-animate/-/auto-animate-1.0.0-beta.6.tgz#ed7f8bc47d774a7764756646e9e3432e8be51cb3"
1976+
integrity sha512-PVDhLAlr+B4Xb7e+1wozBUWmXa6BFU8xUPR/W/E+TsQhPS1qkAdAsJ25keEnFrcePSnXHrOsh3tiFbEToOzV9w==
1977+
19731978
"@graphql-tools/[email protected]":
19741979
version "8.3.1"
19751980
resolved "https://registry.npmjs.org/@graphql-tools/merge/-/merge-8.3.1.tgz"

0 commit comments

Comments
 (0)