I have 2 components in my project where I tried create query based search filter PostsList component: PostFilter component: I must send one API request when filters is change/update. But why I get same values in activeFilters and in coming filters from method setFilters() of PostsList component on everytime? Why I lose old value of activeFilters before set new values
Tag: vue-component
Vue js does not change route – vue route does not work
main.js Homepage.vue App.js Everything seems normal, it only worked once, but I don’t know what changes in the main js and it stopped working again It is a simple code, in the main one I declared the routes, and in the home page I put the link tags to redirect to the components. but none of this works, installation was
Pass nested object name as props to component
I have made a component for my forms which I pass the main object as props to the component. For it’s items I pass a json including each form input’s data. In this data I pass the property name to …
Creating an dropdown menu using a Vue instance
I switched from React to Vue and for me there are some incomprehensible nuances I want to create a drop-down menu, but I have some incomprehensible things related to this who is familiar with React knows that you can create a certain property with a boolean value inside a state or using hooks then when clicking on the buttons, use
Vue 3 Composition API: using props as initial value for component data
So I am building a search page in Vue 3 using the composition API. I have a component which takes a set of data from the parent and shows a snippet of the data including where the keyword is, and so it needs to make a working copy of this data to make a displayable value. I had a lot
Vue: Using Vuex store in beforeRouteEnter hook to cancel navigation
I am trying to get vue-router to check a list of permissions, before finishing the navigation to a new route. The permissions are stored in vuex and ideally I’d want to avoid passing them as props everywhere. When I use the next(vm => {}) callback, regardless of the outcome, it routes to next page, even though it should receive false
Watch child properties from parent component in vue 3
I’m wondering how I can observe child properties from the parent component in Vue 3 using the composition api (I’m working with the experimental script setup). I want to understand how I can watch changes in the child component from the parent component. My not working solution is inspired by the Vue.js 2 Solution asked here. So I don’t want
Importing a function in Vue 3 setup
Currently, im trying to call a throttle/debounce function in my Vue component, but every time it’s called a Uncaught TypeError: functionTD is not a function si throw here is my code. useThrottleDebounce.ts and this is when it’s called inside setup in my component Answer The issue is that useThrottleDebounce doesn’t return a function, therefore functionTD is not a function:
Vuex 4, State is empty in component
I am trying to access subjects store state using this.$store.state.subjects inside my home component however it comes up as an empty array. Using console.log the only place I am able to see the state.subjects populated is if its in the mutation function. Anywhere else the console.log is empty. It seems to me that the state is not persisting from the
v-slot is always undefined in VueJS
Here is the problem. Root view: Grid component (container): And finally grid item component: I’m getting the error: GridItem.vue Uncaught (in promise) TypeError: Cannot read property ‘testData’ of undefined. I’m cracked my head trying to understand what’s going wrong. Need help, thanks for your time. Answer Get your slot props in Home component: