Skip to content

Tag: vue.js

I want to add counter in for loop in each item.(vue.js)

I’m making cart app with Vue. And trying to make quantity counter, but when I click – or + button, all of items quantity also increase or decrease. So it seems like I need to give each key for buttons but I don’t know how to do that. Answer Your num variable shouldn’t be in your compon…

How to make routes case sensitive in Nuxt

I use nuxt.js + vue.js. I need to create case sensitivity of routers. I found the following property: caseSensitive. I’m trying to put it into nuxt.config but it doesn’t work, the transition is possible by links in upper case. If I directly change the file ~project/.nuxt/router.js, everything works correctly.…

Problems getting data on event change vue and laravel

I’m having a hard time getting data from an event triggered by a change in a select, let me show you the code: This is the select: This is the method: This is the function in the controller: That’s the route: In payloads on Vue Developer Tools i get the values that i expect but still get the error…

How to mock dispatch in vueJs testing

I am currently performing unit tests on my application as seen. But I have a problem. How to mock or exploit the dispatch of Vuex ? My method to test : My unit test : I have a error message : Dispatch is not a function. Why ? Do you help me please ? I don’t understand why I had