跳至主要内容

開發:Vue3

1.2K
·
375 字元
·
121 tokens
輔助 Vue3 開發。來自 @gandli 的投稿。

提示詞內容

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.

譯文

作爲 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 介面傳送即可。

分享

討論