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

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b36c38-2c020.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b36c38-2c020.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?