Vue computes attribute computed that no direct arguments can be passed
You can use closure functions to implement the need to pass parameters
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:
- Mybatis passes in multiple parameters to mapper. And uses @param details to report an error
- The influence of the loading order of props, data and computed in Vue
- An error occurs when pymysql uses% d to pass in parameters
- Vue uses this. $refs. Subcomponent Ref. method to report an error: cannot read property ‘resetfields’ of undefined problem
- The Vue parent component uses ref to call the sub component method and reports an error
- Common attributes and methods of list and map in Dar
- Vue agent reports an Error 404 nginx configuration method
- The attribute error: he has no attributes.
- Solution to the problem of multiple parameters when using pipeline under Linux
- Four ways to get Django parameters in request
- Pass parameters to the YML file, ansible playbook command
- C#: How to Use Httpclient to upload files with other parameters
- Method of getting app. Config. Globalproperties. X directly from vue3
- Error: l6242e: cannot link object arm_ cos_ f32.o as its attributes are incompat
- [Elasticsearch] es 7.12 Root mapping definition has unsupported parameters: _all
- The back end cannot receive the parameters passed by the front end
- Failed to parse mapping [_doc]: Root mapping definition has unsupported parameters:
- Caused by: java.sql.SQLException: Parameter index out of range (1 > number of parameters, which is 0
- Idea for Mac setting JVM running parameters to solve running stuck problem
- Difference between isempty method and isblank method in stringutils