Skip to content

Commit

Permalink
docs: Add Vue 3 Composition API best practices and folder structure
Browse files Browse the repository at this point in the history
  • Loading branch information
iFwu committed Nov 8, 2024
1 parent 79c881f commit e0cd301
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .cursorrules
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Vue 3 Composition API best practices:
1. Use setup() function for component logic
2. Utilize ref and reactive for reactive state
3. Implement computed properties with computed()
4. Use watch and watchEffect for side effects
5. Implement lifecycle hooks with onMounted, onUpdated, etc.
6. Utilize provide/inject for dependency injection

Folder structure:
src/
components/
composables/
views/
router/
store/
assets/
App.vue
main.ts

Additional instructions:
1. Use TypeScript for type safety
2. Implement proper props and emits definitions
3. Utilize Vue 3's Teleport component when needed
4. Use Suspense for async components
5. Implement proper error handling
6. Follow Vue 3 style guide and naming conventions
7. Use Vite for fast development and building

0 comments on commit e0cd301

Please sign in to comment.