Courses
Vue Foundations Vue Fullstack Vue Enterprise
Articles
Latest Topics
More
Newsletter Sponsorship Discord About
The video for this lesson is currently being updated, please read the transcript instead.
Build Your First Vue.js App > Lesson 17

Hiding cart if empty

Looking at the completed version of the store, there's a pretty cool feature in here, where if the shopping cart is empty, it says no items in the cart.

Then, when we add an item to the cart, that text disappears and instead we see the content of the cart, and the total.

To achieve this, let's add another div below the total, and in this one, we'll put the text "No items in the cart.".

<div>
    <div>Total: {{ total }}</div>
</div>
<div>

Back to course page

Click to load comments...

Courses
  • Vue Foundations
  • Vue Fullstack
  • Vue Enterprise
Articles
  • Latest
  • Topics
Newsletter
  • Join
  • Sponsorship
More
  • Discord
  • Vue.js jobs
  • About

Vue.js Developers © 2021. View our privacy policy .

  • RSS
  • |
  • Atom