Skip to content

Commit

Permalink
feat(hanzi): 添加查字功能
Browse files Browse the repository at this point in the history
  • Loading branch information
FuckDoctors committed Mar 3, 2024
1 parent 73bbbe4 commit bd2e54f
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .markdownlint.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"Catalog",
"Replit",
"SiteInfo",
"Hanzi"
"Hanzi",
"Chazi"
]
}
}
2 changes: 2 additions & 0 deletions docs/.vuepress/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import type { ClientConfig } from '@vuepress/client'
import AutoArticleListLayout from './theme/layouts/AutoArticleListLayout'
import AutoArticleList from './theme/components/AutoArticleList'
import Hanzi from './theme/components/hanzi/Hanzi.vue'
import Chazi from './theme/components/hanzi/Chazi.vue'

// 为项目主页的特性添加闪光效果
import 'vuepress-theme-hope/presets/shinning-feature-panel.scss'
Expand All @@ -24,5 +25,6 @@ export default defineClientConfig({
enhance: ({ app }) => {
app.component('AutoArticleList', AutoArticleList)
app.component('Hanzi', Hanzi)
app.component('Chazi', Chazi)
},
})
25 changes: 25 additions & 0 deletions docs/.vuepress/theme/components/hanzi/Chazi.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<script setup>
import { ref } from 'vue'
import Hanzi from './Hanzi.vue'
const input = ref('')
const zi = ref('')
function handleClick() {
zi.value = input.value
}
</script>

<template>
<div class="container">
<label>
汉字
<input v-model="input" type="text" maxlength="1" />
</label>
<button @click="handleClick">查</button>
</div>
<div class="result">
<Hanzi v-if="zi" :key="zi" :zi="zi" />
</div>
</template>
19 changes: 19 additions & 0 deletions docs/posts/edu/chazi.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
star: 99
article: true
date: 2024-03-03
category:
- edu
tag:
- edu
- 教育
- 汉字
head:
- - meta
- name: description
content: 汉字学习,查看笔画,笔划,笔顺
---

# 查字

<Chazi />
4 changes: 4 additions & 0 deletions docs/posts/edu/learn-hanzi.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,7 @@ head:
<Hanzi zi="" :zuci="['春风', '春雨', '春天', '春日']" />
<Hanzi zi="" :bihua="['撇', '横撇', '捺', '点', '点']" />
<Hanzi zi="" pinyin="fēng" jiegou="独体字" :zuci="['风雨', '风云', '大风', '东风']" />

## 查字

<Chazi />

0 comments on commit bd2e54f

Please sign in to comment.