3

I got this.

Now, I wan't to know if this is possible

computed : {
    X: function(a,b){
      return(a*b)
    },
    Y: function(e){
      var c = this.X(3,2)
      return(c)
    }
}

I want to be able to send two arguments (3,2) into function:X and then have the computed result sent back to Y. So far, this has failed. I've read this but it led me nowhere in particular.

tony19
  • 125,647
  • 18
  • 229
  • 307
Siddhant Rimal
  • 975
  • 2
  • 11
  • 32

1 Answers1

3

Use methods rather than computed:

methods: {
    X: function(a,b){
      return(a*b)
    },
    Y: function(e){
      var c = this.X(3,2)
      return(c)
    }
}
kots
  • 465
  • 2
  • 7