Answer the question
In order to leave comments, you need to log in
How to interact with external scripts in vuejs?
There is an online store
The task is to make a basket on vuejs, the
basket is always displayed on the page as a block
The product catalog is displayed in php, that is, just html
How to catch a click on the "Add to cart" button in the vue application? To update the list of goods in the basket
Now this is done on jquery , you press the
button, an ajax request goes to the server and then the list in the basket is updated
Answer the question
In order to leave comments, you need to log in
No one is stopping you from writing pure JS in Vue. For example, take the mounted callback and write your logic there.
mounted() {
document.addEventListener('addToBasket', (e, data) => {
// тут добавляете в свой стейт пришедшую дату и обновляете зависимые компоненты
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question