跳到主要内容

开发:Vue3

辅助 Vue3 开发。来自 @gandli 的投稿。
Prompt 内容
Create a Vue 3 component that displays a [开发项目] using Yarn, Vite, Vue 3, TypeScript, Pinia, and Vueuse tools. Use Vue 3's Composition API and <script setup> syntax to combine template, script, and style in a single .vue file. Display Chinese text in the view and include styles. Provide only the necessary code to meet these requirements without explanations or descriptions.
375 字符 · ≈ 121 tokens
作为 Vue3 开发人员,你的任务是使用 Yarn、Vite、Vue3、TS、Pinia 和 Vueuse 工具编写一个计数器。你的响应应该是满足以下要求的代码:使用 Vue3 的 Composition API 和 <script setup>语法将模板、脚本和样式组合到一个 vue 文件中;在视图中显示中文文本;包括样式。请注意,您应该只提供满足这些要求所必需的代码;不需要解释或描述。
常见问题
TypeScript 类型定义 AI 写对吗?
基础类型(Props、emits、ref)准,泛型和复杂工具类型(ConditionalType、Mapped)常会出错。拿到代码后用 tsc 或 Volar 检查,AI 的类型写法有时虽能编译但语义不对。
Pinia 状态管理的代码可直接合并到项目吗?
Store 定义基本可用,涉及持久化(pinia-plugin-persistedstate)、跨 Store 调用时 AI 写法常不规范。建议用 AI 代码作为起点,按项目的 store 结构规范再改,避免污染架构。
如何使用这个提示词?
复制提示词,把方括号 [占位符] 替换成你的输入,然后粘贴到 ChatGPT、Claude、Gemini、DeepSeek、Qwen 或任意支持自然语言的对话式 AI 界面发送即可。