S
S
sickgang2020-07-16 11:28:46
Vue.js
sickgang, 2020-07-16 11:28:46

How, when clicking on an element in a component, close it and open another one?

There is an App.vue component, a shopping cart component is connected in it, and a modal window component after placing an order:

<basket v-show="showModalBasket" @close="showModalBasket = false"></basket>
  <basketend v-if="showModalBasketEnd"></basketend>

  data() {
    return {
        showModalBasket: false
        showModalBasketEnd: false
    }
  }

You need to make it so that when you click on the checkout button in the cart component, it closes and the modal window component opens, where it says "thank you for the order."

How can I do that?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Vasilev, 2020-07-16
@sickgang

corzina(v-if="uslovie")
modal(v-else)
in date uslovie: true/false
https://ru.vuejs.org/v2/guide/conditional.html#v-if

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question