Catalog / Vue.js Cheat Sheet
Vue.js Cheat Sheet
A concise reference for Vue.js, covering essential concepts, syntax, directives, and components.
Core Concepts & Syntax
Instance Creation
|
Creates a new Vue instance. Options:
|
Example |
|
Data Binding
|
Text interpolation (double curly braces). |
|
Two-way data binding (forms). |
|
Dynamically bind an attribute to an expression. |
Example of v-model |
|
Example of v-bind |
|
Directives
|
|
|
|
Components
Component Definition
|
Registers a global component. Options:
|
Example |
|
Local Registration |
Components can also be registered locally within another component’s |
Props
|
Declares props that the component accepts. |
Prop Types |
|
Prop Validation |
|
Emitting Events
|
Emits a custom event from the component. |
Example |
|
Computed Properties & Watchers
Computed Properties
Define |
|
Usage |
|
Getter/Setter |
|
Watchers
Basic Watcher |
|
Options |
|
When to use |
Use watchers for asynchronous or expensive operations in response to data changes. Computed properties are better for synchronous value derivations. |
Lifecycle Hooks
|
|
|
|
|
|
|
|
Vue Router
Installation
|
Basic Configuration
Import |
|
Routes |
|
Router Links
|
|
|
|
Dynamic Route Matching
Define |
|
Access |
|