Vue 3 Certification

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

1) Given the following code block, which of the following is true?

<MyComponent :active=”true” @change=”doThing” />

The parent of MyComponent will call a function doThing when MyComponent emits the
change event.

2) one-way = v-bind

3) Which directive is used for one-way attribute binding in Vue.js?

v-bind

4) Which code block correctly shows the text “no items” when a reactive variable ‘items’ is an
empty array?
<div v-if="items.length">...</div>
<div>No items</div>

5) Vue.js has TypeScript support

True

6) Given the following code block, how many times is “hello” logged to the console?

0
const fish = ref({
name: 'Blubbles',
fins:2,
hobbies: ['swimming', 'sleeping']
})

watch(fish, () => console.log('hello'))

fish.value.name = 'Mr. Buttons'

Cuando la variable es ref, para que el watch tome los cambios, se tiene que usar el .value
Si la variable es reactive, si se puede usar fish.
A su vez, si la variable es ref y no se usa el .value, se debe usar el { deep: true } para que se
ejecute el watch, en caso de usar el immediate se ejecutara una sola vez.

7) In a single file component, the '<template>' taag must always come first, before the other
tags like '<script>' and '<stlye>’

False

8) What is the purpose of the 'key' attribute in Vue's 'v-for' directive?

It uniquely identifies each item to make updates more efficient

9) Which of the following is NOT true about an app created with 'npm init vue@latest'
It is server rendered by default

10) Using vue router, how would you register the 'HomeComponent' to be displayed when
visiting the home page (eg. https://example.com/)?

export default createRouter({


routes: [{ path: '/', component: HomeComponent }],
})

11) Which of the following are limitations of the ‘reactive’ function?


It only works for object types

12) Evan you

13) Which of the following best describes VueUse?

A packages that provides a set of reusable Vue composition utilities for use with the
Composition API

14) Given the following handlers object, which of the code snippets correctly attaches all the
event handlers at once?

const handlers = {
click(){…},

update(){…},
remove(){…},
}

<SomeCoolComponent v-on="handlers" />

15) Pinia

16) How can you listen for a custom event emitted by a child component?

v-on

17) What is the purpose of the ‘v-model’ directive?

It is used for two-way data binding between form inputs and component data
18) Which of the following classes is applied during the entire leaving phase when transitioning
an element?

v-leave-active Applied during the entire leaving phase.

v-enter-active Applied during the entire entering phase.

19) In Vue 3, the Options API is built on top of the Composition API

(True??)

20) Computed properties are cached based on their reactive dependencies

True

21) Script ref

22) When is the ‘mounted’ lifecycle hook called?

after the component has been created and inserted into the parent DOM container.

23) Which options below are valid ways of defining the script section in a SFC?

All of them are valid. (???)

24) Vue automatically escapes dynamic attribute bindings for security purposes

True

25) What does the following code do? createApp({}).mount(“#app”)

Creates an application instance and mounts it to the DOM.

26) The benefit of scoped slots is that they allow

the child component to pass data to the slot content in the parent. (???)

27) vuetify

28) Which statement best describes the built-in `<Transition>` component?

Animates elements when they are inserted or removed from the DOM
29) Which of the following best describes Nuxt?
A meta framework…

30) SFC = Single File Component

You might also like