$store properties are not reactive when using computed property (Vuex)

Your code should work if you setup everything correctly: http://codepen.io/CodinCat/pen/RKZeZe?editors=1010 A very common mistake is that you didn’t give your state initial data. You should declare the state shape explicitly, so instead of state: {} // or state: { nav: {} } do this: state: { nav: { type: ‘…’ }, … } or the … Read more

Registering vue components globally

This is easy to accomplish. You can register components globally in the main.js file. import MyComponent from ‘@/components/MyComponent’ Vue.component(‘my-component-name’, MyComponent) Now you can use <my-component-name /> everywhere. A cleaner way, without bloating your main.js, is to import your component in an index.js file in your components folder like this. import Vue from ‘vue’ import MyComponent … Read more

vue: Uncaught TypeError: Cannot read property … of undefined

Just use v-if on a common parent to all the elements in your template relying on that AJAX call, not around each one. So instead of something like: <div> <h1 v-if=”foo.title”>{{ foo.title }}</h1> <p v-if=”foo.description”>{{ foo.description }}</p> </div> Do <div> <template v-if=”foo”> <h1>{{ foo.title }}</h1> <p>{{ foo.description }}</p> </template> </div>