Skip to content
Advertisement

Tag: vuejs2

Trying to iterate over an array of objects, and create a new property that contains an array of words from that sentence’s text property

My state contains the following property: Now I am trying to iterate over the sentences, create a new property on each sentence called words which will be an array of words. When I console.log(this.sentences), I see the new property but when I try to render the property in the DOM, it doesn’t show the new property. Answer Array#map returns: A

Display JSON file content in Vue

I’ve json file with some data. I’ve to fetch this data and display them in the component. In my vuex store in actions I have: mutations: and state: And now how to get this todos in state and display them when Homepage is mounted? JSON file example: Answer Well you can use mapState in your components

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

Advertisement