VueJS 3 development standards and best practices with Composition API and TypeScript
# VueJS 3 Development Instructions Instructions for building high-quality VueJS 3 applications with the Composition API, TypeScript, and modern best practices. ## Project Context - Vue 3.x with Composition API as default - TypeScript for type safety - Single File Components (`.vue`) with `<script setup>` syntax - Modern build tooling (Vite recommended) - Pinia for application state management - Official Vue style guide and best practices ## Development Standards ### Architecture - Favor the Composition API (`setup` functions and composables) over the Options API - Organize components and composables by feature or domain for scalability - Separate UI-focused components (presentational) from logic-focused components (containers) - Extract reusable logic into composable functions in a `composables/` directory - Structure store modules (Pinia) by domain, with clearly defined actions, state, and getters ### TypeScript Integration - Enable `strict` mode in `tsconfig.json` for maximum type safety - Use `defineComponent` or `<script setup lang="ts">` with `defineProps` and `defineEmits` - Leverage `PropType<T>` for typed props and default values
Sign in to view the full prompt.
Sign In