Menu
×
×
Correct!

Exercise:

Fill in the missing code so that the user either sees the text 'in stock' or 'not in stock'.

<div id="app"> <p v-if="typewritersInStock"> in stock </p> <p v-else> not in stock </p> </div> <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script> <script> const app = Vue.createApp({ data() { return { typewritersInStock: true } } }) app.mount('#app') </script>

Not Correct

Click here to try again.

Correct!

Next ❯
<div id="app">
  <p ="typewritersInStock">
    in stock
  </p>
  <p >
    not in stock
  </p>
</div>

<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
<script>
const app = Vue.createApp({
  data() {
    return {
      typewritersInStock: true
    }
  }
})
app.mount('#app')
</script>

    
  




Log in to keep your progress
Sign up to keep your progress

Completed 0 of 54 Exercises:

VUE Get started
VUE Directives
VUE Methods
VUE Computed
VUE Watchers
VUE Scaling up
VUE Components
VUE Slots
VUE Refs
VUE Lifecycle hooks
VUE Provide/Inject
VUE Routing
VUE Animations
VUE Build

×

Reset the Score?

This will reset the score of ALL 54 exercises.

Are you sure you want to continue?



×

Congratulations!

You have finished all 54 VUE exercises.

Share your score: