Vue Js Cheat Sheet

Posted on  by admin



Skills LearnedDescribe Azure Firewall.

Azure Firewall

Shorthand syntax

True or false will add or remove attribute

If isActive is truthy, the class ‘active’ will appear

Style color set to value of activeColor

Describe Azure Firewall.


Element inserted/removed based on truthiness

Toggles the display: none CSS property

Two-way data binding

v-model.lazy="..."Syncs input after change event
v-model.number="..."Always returns a number
v-model.trim="..."Strips whitespace

Expand your knowledge - extra resources.


Calls addToCart method on component

Shorthand syntax

Arguments can be passed

To prevent default behavior (e.g. page reload)

Only trigger once

.stopStop all event propagation
.self Only trigger if is element itself

Keyboard entry example

Call onCopy when control-c is pressed

Firewall is a network security service that monitors and controls incoming and outgoing traffic.

List rendering

The :key is always recommended

To access the position in the array

To iterate through objects

Using v-for with a component

Managed, cloud-based firewall service (PaaS, Firewall as a Service).


Component anatomy

Built-in high availability.

Lifecycle hooks

beforeCreateAfter the instance has been initialized #
createdAfter the instance is created #
beforeMountBefore the first render #
mountedAfter the instance has been mounted #
beforeUpdateWhen data changes, before the DOM is patched #
updatedAfter a data change #
beforeDestroyBefore the instance is destroyed #
destroyedAfter a Vue instance has been destroyed #

Highly Scalable.

Custom events

Set listener on component, within its parent

Inside parent component

Inside button-counter template

Inbound & outbound traffic filtering rules. Support for FQDN (Fully Qualified Domain Name), ex.

Fully integrated with Azure monitor for logging and analytics.

Single file components

Single file

See: Single File Components


See: What About Separation of Concerns?


Using a single slot

Component template

Use of component with data for slot

See: Slots

Multiple slots

Component template

Use of component with data for slots

See: Slots

Also see

  • Vue CLI(
  • Vue Router(
  • Vue DevTools(
  • Nuxt.js(
  • Vue.js v1.0.28 cheatsheetLegacy version