- Vue.js 2 Design Patterns and Best Practices
- Paul Halliday
- 217字
- 2021-06-24 18:33:09
Writing Clean and Lean Code with Vue
In this section, we'll be investigating how a Vue.js instance works at a lower level by looking at how this is handled by Vue. We'll also be looking at the various properties on our instance such as data, computed, watch, as well as best practices when using each one. Furthermore, we'll be looking at the various lifecycle hooks available within our Vue instance, allowing us to call particular functions at various stages of our application. Finally, we'll be investigating the Document Object Model (DOM) and why Vue implements a Virtual DOM for enhanced performance.
By the end of this chapter you will:
- Have a greater understanding of how this keyword works within JavaScript
- Understand how Vue proxies this keyword within Vue instances
- Use data properties to create reactive bindings
- Use computed properties to create declarative functions based on our data model
- Use watched properties to access asynchronous data and build upon the foundations of computed properties
- Use lifecycle hooks to activate functionality at particular stages of the Vue lifecycle
- Investigate the DOM and Virtual DOM for an understanding of how Vue renders data to the screen
To begin, let's start off by looking into how this works within JavaScript and how this relates to the context within our Vue instances.
推薦閱讀
- Mastering Node.js(Second Edition)
- C++黑客編程揭秘與防范
- 智能網聯汽車V2X與智能網聯設施I2X
- 面向物聯網的嵌入式系統開發:基于CC2530和STM32微處理器
- 智慧光網絡:關鍵技術、應用實踐和未來演進
- 面向5G-Advanced的關鍵技術
- Hands-On Microservices with Node.js
- 一本書讀懂物聯網
- Building RESTful Web Services with .NET Core
- Enterprise ApplicationDevelopment with Ext JSand Spring
- 5G智慧交通
- 想象的互動:網絡人際傳播中的印象形成
- 智慧的物聯網:感知中國和世界的技術
- XSS跨站腳本攻擊剖析與防御
- 企業網絡組建與維護項目式教程