Vue Component Flashcards

1
Q

Vue Components

A
  1. Meant to be reusable parts
  2. Components that are meant to be reusable parts are called Components
  3. Components that represent a full page are called Views
    Views contain components
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Single Responsibility Principle

A

A computer-programming principle that states that every module or class should have responsibility for a single part of the functionality provided by the software, and that responsibility should be entirely encapsulated by the class, module, or function.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

VueX

A

Vuex is a state management pattern + library for Vue.js applications. It serves as a centralized store for all the components in an application, with rules ensuring that the state can only be mutated in a predictable fashion.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

VueX Store

A

VueX adds a shared state “store” that will be used by all components in our application.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

VueX Store Part

A
  1. State
  2. Getters
  3. Mutations
  4. Actions
  5. Modules
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

VueX Store - Getters

A

Vuex allows us to define “getters” in the store. You can think of them as computed properties for stores. Like computed properties, a getter’s result is cached based on its dependencies, and will only re-evaluate when some of its dependencies have changed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

VueX Store - Mutations

A

The value of properties in the state should never be changed directly. Instead, they should be changed by committing mutations. A mutation is similar to a setter in a Java class but adds additional functionality.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

VueX Store - Actions

A

Actions work similarly to methods that can be called ( dispatched ) to change state or perform other functionality.
An Action contains business logic and does not necessarily care about the state. However, it can change the state using a mutation.
For example, an Action may load data by calling an API before committing a mutation.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

VueX Store - Modules

A
Modules allow for groups of states, mutations, actions, and getters to be encapsulated together similar to a class.  
This allows for each module to have responsibility for one segment of the VueX state store.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly