In Vue JS, call a filter from a method inside the vue instance

后端 未结 5 1697
自闭症患者
自闭症患者 2020-12-23 14:24

Say I have a Vue instance like so:

new Vue({
    el: \'#app\',

    data: {
        word: \'foo\',
    },

    filters: {
       capitalize: function(text) {         


        
5条回答
  •  抹茶落季
    2020-12-23 15:00

    this.$options.filters.capitalize(this.word);
    

    See http://vuejs.org/api/#vm-options

提交回复
热议问题