Cursor rule
.cursor/rules/vue.mdcCursor rules
Quality
44/100
Scores the file, not the repository.Length
208 words
9 headings · 0 code blocksRepository
624
— · pushed 60 days agoLast changed
3 days ago
First indexed 3 days ago.123456# Vue 开发规范78- 你是一位前端开发专家,精通 Uniapp、Vue、Pinia、Uview Plus 等前端框架910## 代码风格1112- 组件: 使用单文件组件 (SFC)13- API: 使用组合式 API (Composition API) 并搭配 `<script setup>` 语法糖14- 语法: 没有特殊说明则使用 TS 进行开发 `<script setup lang="ts">`1516## 命名1718- 组件 (Component) 命名: 始终采用单词大写开头 (PascalCase) 的命名方式, 并且避免与 HTML 元素冲突19- 组件 (Component) 命名示例: 以全局的 `lang-select` 组件 `@/components/lang-select/index.vue` 和 `@/components/agree-privacy/index.vue` 作为参考,注意 `index` 是不需要遵循大驼峰格式的20- 页面 (Page) 命名: 始终采用短横线连接 (kebab-case) 的命名方式21- 页面 (Page) 命名示例: 以 `home` 页面作为参考 `@/pages/tab/home/index.vue`22- 组合式函数 (Composable) 命名: 始终采用小驼峰 (camelCase) 的命名方式23- 组合式函数 (Composable) 命名示例: 以剪贴板组合式函数作为参考 `@/hooks/use-clipboard/index.ts`24- Props 命名: 在声明 prop 的时候,其命名应该始终采用小驼峰 (camelCase),而在模板应该始终采用短横线连接 (kebab-case)25- Props 命名示例: 声明时 `const { isActive = false } = defineProps<Props>()` 和传递时 `<Demo :is-active="true" />`26- TS 或 JS 文件命名: 始终采用短横线连接 (kebab-case) 的命名方式27- TS 或 JS 文件命名示例: `@/utils/index.ts`2829## API3031- 定义响应式变量时优先使用 `ref` 而非 `reactive`32- 复杂的模板表达式则应该重构为计算属性或方法33- 尽量避免侦听器的循坏触发,防止进入死循环3435## Props3637- Prop 定义应该尽量详细,包括类型、必传、默认值38- 如果是使用了 TS 那么应该使用「基于类型的声明」,示例: `const props = defineProps<Props>()`3940## 状态管理4142- 对应目录: `@/store`43- 使用 Pinia44- Store 应该按模块划分45- 优先使用 Setup store 语法,而不是 Option Store 语法46- 避免无脑使用全局状态管理4748## 样式4950- 优先使用 Scoped CSS,示例: `<style scoped lang="scss">`51- 尽可能避免使用 `!important`52- 优先使用 UnoCSS 内联样式5354## 其他5556- 避免直接操作 DOM57- 尽可能编写原子化组件58- 使用 `v-for` 时必须提供唯一的 `key` (不要轻易使用数组下标 `index` 当做 `key`)59- 不要在同一元素上同时使用 `v-if` 和 `v-for`6061## 参考示例文件6263@/pages/tab/home/index.vue64
Also in oyjt/uniapp-vue3-template
Diff this repo’s formatsOne repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| oyjt/uniapp-vue3-template.cursor/rules/git.mdc · 624 | Cursor rules | git | 33/100 | 3 days ago | |
| oyjt/uniapp-vue3-template.cursor/rules/project.mdc · 624 | Cursor rules | lint-format | 54/100 | 3 days ago | |
| oyjt/uniapp-vue3-template.cursor/rules/ts.mdc · 624 | Cursor rules | types | 30/100 | 3 days ago | |
| oyjt/uniapp-vue3-templateCLAUDE.md · 624 | CLAUDE.md | setuplint-formatagent-behaviour | 82/100 | 3 days ago |
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| hiromaily/go-crypto-wallet.cursor/rules/typescript.mdc · 126 | Cursor rules | setupbuildtestlint-format+6 | 100/100 | 3 days ago | |
| TechSquidTV/Hermes.cursor/rules/10-hermes-api.mdc · 45 | Cursor rules | testlint-formatstylearch+5 | 100/100 | 3 days ago | |
| markstev/mark-starter.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+6 | 99/100 | 3 days ago | |
| Allymahmoud/case-intake-platform.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| dodgecfr/combatfilms-webapp.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| deifos/clipmira-subtitles.cursor/rules/frontend.mdc · 1 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| langflow-ai/langflow.cursor/rules/docs_development.mdc · 153k | Cursor rules | setupbuildtestlint-format+7 | 97/100 | 3 days ago | |
| TechSquidTV/Hermes.cursor/rules/20-hermes-api-tests.mdc · 45 | Cursor rules | teststyletesting-strategysecurity+3 | 97/100 | 3 days ago |
