TAILIEUCHUNG - Handbook of learning vue.js 2: Part 2

Handbook of learning 2 help you learn how to build amazing and complex reactive web applications easily with ; Vuex -managing satate in your application; plugins – building your house with your own bricks; Testing – time to test what we have done so fat; deploying – time to go livel; what is next; solutions to exercises. Please refer to the contents of the document. | Vuex - Managing State in Your Application In the previous chapter you learned one of the most important concepts of data binding. You learned and applied a lot of ways of binding data to our application. You also learned how to use directives how to listen to events and how to create and invoke methods. In this chapter you will see how to manage the data that represents a global application state. We will talk about Vuex a special architecture for centralized states in Vue applications. You will learn how to create a global data store and how to retrieve and change it inside the components. We will define what data is local and what should be global in our applications and we will use the Vuex store to work with a global state in them. Summing it up in this chapter we are going to Understand the difference between local and global application states Understand what Vuex is and how it works Learn how to use data from the global store Learn about store getters mutations and actions Install and use the Vuex store in the shopping list and Pomodoro applications Vuex - Managing State in Your Application Parent-child components communication events and brain teaser Remember our shopping list application Do you remember our ChangeTitleComponent and how we ensured that typing in its input box would affect the title of the shopping list that belongs to the parent component You remember that each component has its own scope and the scope of the parent component cannot be affected by children components. Thus in order to be able to propagate the changes from inside the children components to the parent components we used events. Putting it very simply you can call the emit method from the child component with the name of the event being dispatched and listen to this event within the v-on directive on the parent component. If it is a native event such as input it s even more simple. Just bind the needed attribute to the child component as a v-model and then call the emit

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.