vue.js - Vue 'computed' filters -
is possible pull in variable filter, , have filter update when changes? in computed property?
i'm wanting able like:
vue.filter('t', function(val) { return this.currentlanguage[val]; });
and have filter recompile template when this.currentlanguage
changes.
obviously can pass in additional parameter, don't want have each string.
my code works when switching components, alternatively, there way force recompile? i'm using vue-router
,
this.$route.router.go({ path: this.$route.router.path, query: { t: + new date() } }) }
unfortunately doesn't trigger recompile.
you define reactivity using:
vue.util.definereactive(obj, key, val)
https://jsfiddle.net/pespantelis/qzuyxqq7/3/
also, have created package that:
Comments
Post a Comment