标签:ber default put turn port bank class ted computed
在 2.x,开发者可以使用过滤器来处理通用文本格式。 <template> <h1>Bank Account Balance</h1> <p>{{ accountBalance | currencyUSD }}</p> </template> <script> export default { props: { accountBalance: { type: Number, required: true } }, filters: { currencyUSD(value) { return ‘$‘ + value } } } </script> 在 3.x 中,过滤器已删除,不再支持。相反地,我们建议用方法调用或计算属性替换它们。 <template> <h1>Bank Account Balance</h1> <p>{{ accountInUSD }}</p> </template> <script> export default { props: { accountBalance: { type: Number, required: true } }, computed: { accountInUSD() { return ‘$‘ + this.accountBalance } } } </script>
标签:ber default put turn port bank class ted computed
原文地址:https://www.cnblogs.com/peipeiyu/p/14870339.html