- 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.
推薦閱讀
- Facebook Application Development with Graph API Cookbook
- Java入門經典(第6版)
- Node.js Design Patterns
- 匯編語言編程基礎:基于LoongArch
- 現代C++編程實戰:132個核心技巧示例(原書第2版)
- Flink技術內幕:架構設計與實現原理
- C語言程序設計實踐
- Oracle Database XE 11gR2 Jump Start Guide
- PostgreSQL Developer's Guide
- 小學生C++趣味編程從入門到精通
- Developer,Advocate!
- Python程序設計教程
- Office VBA開發經典:中級進階卷
- 破繭成蝶:用戶體驗設計師的成長之路
- 前端程序員面試筆試通關寶典