Skip to content

Commit e0cd301

Browse files
committed
docs: Add Vue 3 Composition API best practices and folder structure
1 parent 79c881f commit e0cd301

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

.cursorrules

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
Vue 3 Composition API best practices:
2+
1. Use setup() function for component logic
3+
2. Utilize ref and reactive for reactive state
4+
3. Implement computed properties with computed()
5+
4. Use watch and watchEffect for side effects
6+
5. Implement lifecycle hooks with onMounted, onUpdated, etc.
7+
6. Utilize provide/inject for dependency injection
8+
9+
Folder structure:
10+
src/
11+
components/
12+
composables/
13+
views/
14+
router/
15+
store/
16+
assets/
17+
App.vue
18+
main.ts
19+
20+
Additional instructions:
21+
1. Use TypeScript for type safety
22+
2. Implement proper props and emits definitions
23+
3. Utilize Vue 3's Teleport component when needed
24+
4. Use Suspense for async components
25+
5. Implement proper error handling
26+
6. Follow Vue 3 style guide and naming conventions
27+
7. Use Vite for fast development and building

0 commit comments

Comments
 (0)