Vue calculates attributes and passes parameters to the computed method

Vue computes attribute computed that no direct arguments can be passed
You can use closure functions to implement the need to pass parameters

<template>
  <span>{{fmtWeight(1)}}</span>
</template>

<script>
export default {
  data() {
    return {
      weight: 100
    };
  },
  computed: {
    fmtWeight() {
      return num => {
        return this.weight.toFixed(num)
      }
    }
  }
};
</script>

Read More: