feat:增加撒花动画
This commit is contained in:
14
docs/.vitepress/theme/components/Confetti.vue
Normal file
14
docs/.vitepress/theme/components/Confetti.vue
Normal file
@@ -0,0 +1,14 @@
|
||||
<template>
|
||||
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import confetti from "canvas-confetti";
|
||||
|
||||
/* 纸屑 */
|
||||
confetti({
|
||||
particleCount: 100,
|
||||
spread: 170,
|
||||
origin: { y: 0.6 },
|
||||
});
|
||||
</script>
|
||||
@@ -1,27 +0,0 @@
|
||||
<template>
|
||||
<div class="custom-component">
|
||||
<h3>{{ title }}</h3>
|
||||
<p>{{ description }}</p>
|
||||
<button @click="count++">点击次数: {{ count }}</button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
|
||||
const props = defineProps({
|
||||
title: String,
|
||||
description: String
|
||||
})
|
||||
|
||||
const count = ref(0)
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.custom-component {
|
||||
border: 1px solid #e2e2e2;
|
||||
padding: 1rem;
|
||||
border-radius: 8px;
|
||||
margin: 1rem 0;
|
||||
}
|
||||
</style>
|
||||
@@ -1,13 +1,13 @@
|
||||
import DefaultTheme from 'vitepress/theme'
|
||||
import Confetti from "./components/Confetti.vue";
|
||||
import type { EnhanceAppContext } from 'vitepress'
|
||||
|
||||
import '../theme/style.css'
|
||||
import './style/var.css'
|
||||
|
||||
// 定义组件导入的类型
|
||||
interface ComponentModule {
|
||||
default: any
|
||||
}
|
||||
|
||||
export default {
|
||||
extends: DefaultTheme
|
||||
}
|
||||
extends: DefaultTheme,
|
||||
enhanceApp({ app }: EnhanceAppContext) {
|
||||
app.component("Confetti", Confetti);
|
||||
},
|
||||
};
|
||||
|
||||
16
docs/.vitepress/tsconfig.json
Normal file
16
docs/.vitepress/tsconfig.json
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2017",
|
||||
"lib": ["ES2017", "DOM"],
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "node",
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"esModuleInterop": true,
|
||||
"allowJs": true,
|
||||
"strict": true,
|
||||
"skipLibCheck": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"include": ["**/*.ts", "**/*.vue"],
|
||||
"exclude": ["node_modules"]
|
||||
}
|
||||
@@ -27,3 +27,4 @@ features:
|
||||
- title: 🔍 快速检索
|
||||
details: 清晰的分类导航和搜索功能,方便快速定位所需的技术知识点
|
||||
---
|
||||
<Confetti />
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"devDependencies": {
|
||||
"canvas-confetti": "^1.9.4",
|
||||
"vitepress": "1.6.4"
|
||||
},
|
||||
"scripts": {
|
||||
|
||||
37
pnpm-lock.yaml
generated
37
pnpm-lock.yaml
generated
@@ -8,9 +8,12 @@ importers:
|
||||
|
||||
.:
|
||||
devDependencies:
|
||||
canvas-confetti:
|
||||
specifier: ^1.9.4
|
||||
version: 1.9.4
|
||||
vitepress:
|
||||
specifier: 1.6.4
|
||||
version: 1.6.4(@algolia/client-search@5.45.0)(postcss@8.5.6)(search-insights@2.17.3)
|
||||
version: 1.6.4(@algolia/client-search@5.45.0)(@types/node@24.10.1)(postcss@8.5.6)(search-insights@2.17.3)
|
||||
|
||||
packages:
|
||||
|
||||
@@ -440,6 +443,9 @@ packages:
|
||||
'@types/mdurl@2.0.0':
|
||||
resolution: {integrity: sha512-RGdgjQUZba5p6QEFAVx2OGb8rQDL/cPRG7GiedRzMcJ1tYnUANBncjbSB1NRGwbvjcPeikRABz2nshyPk1bhWg==}
|
||||
|
||||
'@types/node@24.10.1':
|
||||
resolution: {integrity: sha512-GNWcUTRBgIRJD5zj+Tq0fKOJ5XZajIiBroOF0yvj2bSU1WvNdYS/dn9UxwsujGW4JX06dnHyjV2y9rRaybH0iQ==}
|
||||
|
||||
'@types/unist@3.0.3':
|
||||
resolution: {integrity: sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==}
|
||||
|
||||
@@ -551,6 +557,9 @@ packages:
|
||||
birpc@2.8.0:
|
||||
resolution: {integrity: sha512-Bz2a4qD/5GRhiHSwj30c/8kC8QGj12nNDwz3D4ErQ4Xhy35dsSDvF+RA/tWpjyU0pdGtSDiEk6B5fBGE1qNVhw==}
|
||||
|
||||
canvas-confetti@1.9.4:
|
||||
resolution: {integrity: sha512-yxQbJkAVrFXWNbTUjPqjF7G+g6pDotOUHGbkZq2NELZUMDpiJ85rIEazVb8GTaAptNW2miJAXbs1BtioA251Pw==}
|
||||
|
||||
ccount@2.0.1:
|
||||
resolution: {integrity: sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==}
|
||||
|
||||
@@ -717,6 +726,9 @@ packages:
|
||||
trim-lines@3.0.1:
|
||||
resolution: {integrity: sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg==}
|
||||
|
||||
undici-types@7.16.0:
|
||||
resolution: {integrity: sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==}
|
||||
|
||||
unist-util-is@6.0.1:
|
||||
resolution: {integrity: sha512-LsiILbtBETkDz8I9p1dQ0uyRUWuaQzd/cuEeS1hoRSyW5E5XGmTzlwY1OrNzzakGowI9Dr/I8HVaw4hTtnxy8g==}
|
||||
|
||||
@@ -1145,15 +1157,20 @@ snapshots:
|
||||
|
||||
'@types/mdurl@2.0.0': {}
|
||||
|
||||
'@types/node@24.10.1':
|
||||
dependencies:
|
||||
undici-types: 7.16.0
|
||||
optional: true
|
||||
|
||||
'@types/unist@3.0.3': {}
|
||||
|
||||
'@types/web-bluetooth@0.0.21': {}
|
||||
|
||||
'@ungap/structured-clone@1.3.0': {}
|
||||
|
||||
'@vitejs/plugin-vue@5.2.4(vite@5.4.21)(vue@3.5.25)':
|
||||
'@vitejs/plugin-vue@5.2.4(vite@5.4.21(@types/node@24.10.1))(vue@3.5.25)':
|
||||
dependencies:
|
||||
vite: 5.4.21
|
||||
vite: 5.4.21(@types/node@24.10.1)
|
||||
vue: 3.5.25
|
||||
|
||||
'@vue/compiler-core@3.5.25':
|
||||
@@ -1274,6 +1291,8 @@ snapshots:
|
||||
|
||||
birpc@2.8.0: {}
|
||||
|
||||
canvas-confetti@1.9.4: {}
|
||||
|
||||
ccount@2.0.1: {}
|
||||
|
||||
character-entities-html4@2.1.0: {}
|
||||
@@ -1490,6 +1509,9 @@ snapshots:
|
||||
|
||||
trim-lines@3.0.1: {}
|
||||
|
||||
undici-types@7.16.0:
|
||||
optional: true
|
||||
|
||||
unist-util-is@6.0.1:
|
||||
dependencies:
|
||||
'@types/unist': 3.0.3
|
||||
@@ -1523,15 +1545,16 @@ snapshots:
|
||||
'@types/unist': 3.0.3
|
||||
vfile-message: 4.0.3
|
||||
|
||||
vite@5.4.21:
|
||||
vite@5.4.21(@types/node@24.10.1):
|
||||
dependencies:
|
||||
esbuild: 0.21.5
|
||||
postcss: 8.5.6
|
||||
rollup: 4.53.3
|
||||
optionalDependencies:
|
||||
'@types/node': 24.10.1
|
||||
fsevents: 2.3.3
|
||||
|
||||
vitepress@1.6.4(@algolia/client-search@5.45.0)(postcss@8.5.6)(search-insights@2.17.3):
|
||||
vitepress@1.6.4(@algolia/client-search@5.45.0)(@types/node@24.10.1)(postcss@8.5.6)(search-insights@2.17.3):
|
||||
dependencies:
|
||||
'@docsearch/css': 3.8.2
|
||||
'@docsearch/js': 3.8.2(@algolia/client-search@5.45.0)(search-insights@2.17.3)
|
||||
@@ -1540,7 +1563,7 @@ snapshots:
|
||||
'@shikijs/transformers': 2.5.0
|
||||
'@shikijs/types': 2.5.0
|
||||
'@types/markdown-it': 14.1.2
|
||||
'@vitejs/plugin-vue': 5.2.4(vite@5.4.21)(vue@3.5.25)
|
||||
'@vitejs/plugin-vue': 5.2.4(vite@5.4.21(@types/node@24.10.1))(vue@3.5.25)
|
||||
'@vue/devtools-api': 7.7.9
|
||||
'@vue/shared': 3.5.25
|
||||
'@vueuse/core': 12.8.2
|
||||
@@ -1549,7 +1572,7 @@ snapshots:
|
||||
mark.js: 8.11.1
|
||||
minisearch: 7.2.0
|
||||
shiki: 2.5.0
|
||||
vite: 5.4.21
|
||||
vite: 5.4.21(@types/node@24.10.1)
|
||||
vue: 3.5.25
|
||||
optionalDependencies:
|
||||
postcss: 8.5.6
|
||||
|
||||
Reference in New Issue
Block a user