Vue Js Cheat Sheet

Posted on  by admin

Firewall

Navigation

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.

Directives

Element inserted/removed based on truthiness

Toggles the display: none CSS property

Two-way data binding

MethodDescription
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.

Actions/Events

Calls addToCart method on component

Shorthand syntax

Arguments can be passed

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

Only trigger once

MethodDescription
.stopStop all event propagation
.self Only trigger if event.target 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

Component anatomy

Built-in high availability.

Lifecycle hooks

MethodDescription
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

Separation

See: What About Separation of Concerns?

Slots

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(cli.vuejs.org)
  • Vue Router(router.vuejs.org)
  • Vue DevTools(chrome.google.com)
  • Nuxt.js(nuxtjs.org)
  • Vue.js v1.0.28 cheatsheetLegacy version