Quiz: Handling User Input

Please enjoy this self-check quiz to help you identify key concepts, points, and techniques discussed in this section.

What is the action property of a form provide?

the name of the method used to handle the form the URL where the form should be submitted (and browser redirected) the name of the variable used the time the form was generated The action property refers to the URL where the form should be submitted (and browser redirected).

What methods can be used to submit a form online?

snailmail post get receive The post and get methods are used to submit forms online.

Which directive do we use to connect an input field and a value in the component's data?

v-bind v-model v-if v-on The v-model directive is used to bind an input field and the value in the component's data.

Which of the following modifiers are provided to help handle data in form fields?

.active .lazy .number .trim The .lazy, .number, and .trim modifiers are provided to help handle data in form fields.

What should we always include in at the beginning of set of elements in a tag?

A welcome statement. A comment explaining what we're selecting. A dummy choice that is disabled so the user is forced to select a different option. The default option. Providing a dummy choice as the default option in a element insures data will be bound and synced properly.

Which directive defines an event listener in Vue.js templates?

v-if v-for v-on v-model The v-on directive is used to define an event listener in a Vue.js template.

What events can be listened for in a Vue.js application?

click and submit Events emitted by an HTML element Custom events defined by the developer Cool concerts nearby The v-on directive can listen for any event emitted by an HTML element or custom events created by developers.

What do we often use to handle an event in our Vue.js components?

component function component method JavaScript statements HTML forms We often handle events using component methods we have defined as part of our Vue.js component.

Which directives are useful for controlling which handlers execute when an event is triggered?

.stop .go .prevent .once The .stop, .prevent and .once directives can be used to control which handlers execute when an event is triggered.

What do the modifiers .enter, .ctrl, and .tab do?

They filter keyboard events so the handler executes only when the corresponding key is pressed They indicate the method used to handle an event They exclude the key from any event listener Those modifiers filter keyboard events so the handler executes only when the corresponding key is pressed.

Which keyboard event would we use if we wanted to make a "new file" keyboard shortcut?

keydown keypress keyup The keypress event would be best for making a keyboard shortcut.

Which keyboard event would we use if we were adding hotkeys to an app?

keydown keypress keyup The keyup event would be best for adding hotkeys to an app.

Which keyboard event would we use if we were building a virtual game direction pad?

keydown keypress keyup The keydown event would be best for making a responsive virtual game direction pad.

Visit Quiz Online

The quiz on this page has been removed from your PDF or ebook format. You may take the quiz by visiting this book online.

results matching ""

    No results matching ""