# 分享一个带娃练习拼音的工具和一段vue长按指令

* 抖音：<https://v.douyin.com/hp56ygu/>
* B站：<https://www.bilibili.com/video/BV1Pe4y1j7a1/>

> **工具入口：**
>
> <https://sunzsh.github.io/pinyin/>
>
> **代码 / 文件：**
>
> <https://github.com/sunzsh/pinyin-vue>

这个是前两天我陪孩子

复习拼音的时候

写的一个小工具

主要的用途就是把它投屏到电视上

然后这样点击随机来切换考他拼音

后来呢我就发现需要一个长按的功能

大家看就像这样

然后呢

就在网上找了一个非常好用的vue里

长按的一个指令

就是这个longpress.js

用的时候先把它注册到main.js里边

像这样

然后呢使用的时候就很简单了

直接在这儿v-longpress

然后指定一个方法就行了

那整个这个项目

我已经把它放到github上了

大家如果只需要这个longpress.js

可以从这来找


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://sunzsh.gitbook.io/xiaoshan.bug/fen-xiang-yi-ge-dai-wa-lian-xi-pin-yin-de-gong-ju-he-yi-duan-vue-chang-an-zhi-ling.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
