Posts for: #Frontend

Vue and TypeScript

Learn you a TypeScript for better Vue Instruct Vue on the component to use TypeScript and type up the export default by wrapping it in defineComponent() Props <script lang="ts"> import { defineComponent } from 'vue' import type { PropType } from 'vue' type Restaurant = { id: string name: string address: string website: string status: string } export default defineComponent({ props: { restaurant: { type: Object as PropType<Restaurant> } } }) .
Read more →

Vue

A bunch of (scattered) tips and resources as I experiment with Vue. Basics: General wisdom Anatomy Eventhandling Watchers Computed props Components: Components Props Lifecycle hooks Emitting events Slots Fetching Data: Calling APIs in hooks Unique identifiers Styling Components: Global vs scoped styles CSS modules CSS v-bind Composition API: Composition API Reactive references script setup Composables Routing and Deployment: Vue Router History Dynamic routes Deployment Advanced: Pre-processors Pinia State Management Overview What is Vue?
Read more →