Is there a better alternative for Mini Program mpvue to write method directly in template?

<div>{{a(1)}}</div>

methods:{
    a(n){
       return n+1; 
    }
}    

is there any alternative for features like this that cannot be used in Mini Program mpvue?

Mar.28,2021

the computed attribute can be

Menu