- Vue.js 2.x by Example
- Mike Street
- 84字
- 2021-07-02 20:00:29
Combining the format functions
Our next optimization will be to combine the formatBalance and formatDate methods in our Vue instance. This would then allow us to scale our format functions without bloating the code with several methods with similar functionality. There are two ways to approach a format style function—we can either auto-detect the format of the input or pass the desired format option in as a second option. Both have their pros and cons, but we'll walk through both.
推薦閱讀
- Mastering Concurrency Programming with Java 8
- 軟件安全技術(shù)
- Extending Jenkins
- Designing Machine Learning Systems with Python
- WSO2 Developer’s Guide
- 人人都是網(wǎng)站分析師:從分析師的視角理解網(wǎng)站和解讀數(shù)據(jù)
- Go并發(fā)編程實(shí)戰(zhàn)
- RSpec Essentials
- SQL Server與JSP動(dòng)態(tài)網(wǎng)站開發(fā)
- Lighttpd源碼分析
- ASP.NET開發(fā)與應(yīng)用教程
- C語(yǔ)言程序設(shè)計(jì)簡(jiǎn)明教程:Qt實(shí)戰(zhàn)
- Emgu CV Essentials
- Python Programming for Arduino
- 企業(yè)級(jí)Java現(xiàn)代化:寫給開發(fā)者的云原生簡(jiǎn)明指南