$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

How to access a computed property from a method in a Single File Component with Vue.js

You can access computed properties like a property, not like a method: // correct console.log(this.myProperty); // wrong console.log(this.myProperty()); Note: If you treat it as a method with paracentesis () it shall throw an error like this Error in v-on handler: “TypeError: this.myProperty is not a function”.

Use placeholders in yaml

Context YAML version 1.2 user wishes to include variable placeholders in YAML have placeholders replaced with computed values, upon yaml.load be able to use placeholders for both YAML mapping keys and values Problem YAML does not natively support variable placeholders. Anchors and Aliases almost provide the desired functionality, but these do not work as variable … Read more

Vuex – Computed property “name” was assigned to but it has no setter

If you’re going to v-model a computed, it needs a setter. Whatever you want it to do with the updated value (probably write it to the $store, considering that’s what your getter pulls it from) you do in the setter. If writing it back to the store happens via form submission, you don’t want to … Read more

Methods vs Computed in Vue

Computed values and methods are very different in Vue and are definitely not interchangeable in most cases. Computed Property A more appropriate name for a computed value is a computed property. In fact, when the Vue is instantiated, computed properties are converted into a property of the Vue with a getter and sometimes a setter. … Read more

Reactjs setState() with a dynamic key name?

Thanks to @Cory’s hint, i used this: inputChangeHandler : function (event) { var stateObject = function() { returnObj = {}; returnObj[this.target.id] = this.target.value; return returnObj; }.bind(event)(); this.setState( stateObject ); }, If using ES6 or the Babel transpiler to transform your JSX code, you can accomplish this with computed property names, too: inputChangeHandler : function (event) … Read more