Skip to content
Advertisement

Tag: vue-component

What’s causing the Vue computed property to be computed?

My understanding of computed properties is that if the computed property is not used in the template it’s not supposed to be computed. However, when there is a watcher for a computed property, this computed property is evaluated. I understand it’s not desired application architecture, but my question is if the fact that it’s working this way is a desired

VueJS : Unhandled error with simple script

Still learning VueJS, I just wanted to know why when I click on my button my function selection doesn’t work. All the rest in the created() is fine and shows the correct , but in my methods section, just to show a console.log on a click event I have this error : [Vue warn]: Unhandled error during execution of native

Does the store object in vuex fall through to leaf components?

Following the docs: https://vuex.vuejs.org/guide/mutations.html#committing-mutations-in-components and the video tutorial: https://scrimba.com/scrim/ckMZp4HN?pl=pnyzgAP it’s not clear (to me) whether store is visible in nested/child components present in the component that includes it. Answer From the docs you’ve linked (emphasis mine): You can commit mutations in components with this.$store.commit(‘xxx’), or use the mapMutations helper which maps component methods to store.commit calls (requires root store injection)

Vue array prop in child component not updating

I have a model from a backend where the property that normally contains an array of elements can be nullable. When this happens I’ll init it to an empty array. However when doing that it seems to break my ability to update the array in the child component. Sample code can be found below. If data in the main component

Vue router-view isn’t displaying all views

Sorry for the heavy text. All of my router-views work, except for one, which shows blank. I do not see any console errors of warnings and the format is identical between views – the only difference is the template. This was working, but I started a new project because my package.json and dependencies got messy. I’ve read through the code

Advertisement