Vue.js

Vue.js

Test your Vue.js knowledge with free quizzes on MyCodeSkills covering core concepts.


  1. Vue.js is a __?

    • Library for backend
    • CSS framework
    • Frontend JavaScript framework
    • Python tool
  2. Which directive binds an attribute to an expression?

    • v-model
    • v-if
    • v-for
    • v-bind
  3. What does {{ message }} represent in Vue.js?

    • JavaScript alert
    • Vue filter
    • Template interpolation
    • Method call
  4. What is the correct directive for conditional rendering?

    • v-loop
    • v-show
    • v-if
    • v-hide
  5. Which directive is used for looping through data?

    • v-while
    • v-loop
    • v-for
    • v-each
  6. What is the purpose of the watch property in Vue.js?

    • To define components
    • To monitor changes in data
    • To create routes
    • To add animations
  7. How do you pass props to a component in Vue?

    • Using v-prop
    • Using bind-prop
    • Using props directive
    • Using attributes
  8. Which lifecycle hook is called after the component is mounted?

    • beforeMount
    • mounted
    • created
    • updated
  9. How do you create a two-way binding in Vue?

    • v-if
    • v-model
    • v-bind
    • v-on
  10. What is Vue CLI primarily used for?

    • Testing only
    • Server management
    • Scaffolding and development setup
    • Database configuration
  11. What is the primary benefit of the Composition API in Vue 3?

    • Easier HTML templating
    • Better TypeScript support and logic reuse
    • Global state management
    • Automatic routing
  12. Which lifecycle hook is used to clean up side effects in Composition API?

    • onCleanup
    • onUnmounted
    • beforeDestroy
    • afterUnmounted
  13. What does the provide() function do in Vue 3?

    • Injects dependencies globally
    • Provides data to descendant components
    • Shares props between siblings
    • Exposes state to Vuex
  14. How does defineAsyncComponent() enhance performance?

    • Reduces file size
    • Enables lazy loading of components
    • Optimizes reactivity
    • Enables server rendering
  15. What is a common use case for Vue's Teleport feature?

    • Passing props
    • Sending data to Vuex
    • Rendering modals outside component tree
    • Routing between pages