Module2 Flashcards

1
Q

How do you create a Vue app?

A

You call the Vue.createApp() function with an Object Vue.createApp({});

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

How do you connect the Vue app to your HTML

A
You create the app and store it in a variable then you
run the mount function on it with a selector for the area of the HTML you want to control.
const app = Vue.createApp().mount('#app');
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How do you define the data model of the Vue app?

A

you create a Data function (Data(){} - shorthand syntx) that returns an object with the data fields for the app

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

What is interpolation?

A

Interpolation is when you use {{ }} to show a value that is returned in the Data object of the vue app. This syntax only works between open and closed html tags, meaning only places that can display content.

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

What is computed?

A

computed is another section in the app that is made to keep functions that are used to return and display a computed value based on the fields in the data object. It is computed only if those fields change

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

What is v-bind

A

v-bind is a directive that binds an attribute to a value / function in the app. We need to use it since you cannot use interpolation where content is not expected like in the link for an href.

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

which directive is used to connect an attribute with a method or value in the app

A

The directive is v-bind it’s shorthand is :attributeName=”somethingFromConfg”

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

how do you recognize a vue directive

A

Vue directives all start with v-

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

what is methods

A

methods is a reserved word in vue for an object in the app configuration where we keep methods that we want to invoke from the html.

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

how do you manipulate fields from the data object returned by data inside the methods in the methods objects

A

you need to refer to the data fields using this.

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

how do you output raw html using vue

A

In order to output raw html in Vue you need to use the v-html directive.

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