Book description
Learn the core concepts of Vue.js, the modern JavaScript framework for building frontend applications and interfaces from scratch. With concise, practical, and clear examples, this book takes web developers step-by-step through the tools and libraries in the Vue.js ecosystem and shows them how to create complete applications for real-world web projects.
Youâ??ll learn how to handle data communication between components with Pinia architecture, develop a manageable routing system for a frontend project to control the application flow, and produce basic animation effects to create a better user experience.
This book also shows you how to:
- Create reusable and lightweight component systems using Vue.js
- Bring reactivity to your existing static application
- Set up a project using Vite.js, a build tool for frontend project code management
- Build an interactive state management system for a frontend application with Pinia
- Connect external data from the server to your Vue application
- Control the application flow with static and dynamic routing using Vue Router
- Fully test your application using Vitest and Playwright
Publisher resources
Table of contents
- Preface
- 1. Welcome to the Vue.js World!
-
2. How Vue Works: The Basics
- Virtual DOM Under the Hood
- The Vue App Instance and Options API
- Exploring the Options API
- The Template Syntax
- Creating Local State with Data Properties
- How Reactivity in Vue Works
- Two-Way Binding with v-model
- Using v-model.lazy Modifier
- Binding Reactive Data and Passing Props Data with v-bind
- Binding to Class and Style Attributes
- Iterating over Data Collection Using v-for
- Adding Event Listener to Elements with v-on
- Conditional Rendering Elements with v-if, v-else, and v-else-if
- Conditional Displaying Elements with v-show
- Dynamically Displaying HTML Code with v-html
- Displaying Text Content with v-text
- Optimizing Renders with v-once and v-memo
- Registering a Component Globally
- Summary
-
3. Composing Components
- Vue Single File Component Structure
- Using defineComponent() for TypeScript Support
- Component Lifecycle Hooks
- Methods
- Computed Properties
- Watchers
- The Power of Slots
- Using Named Slots with Template Tag and v-slot Attribute
- Understanding Refs
- Sharing Component Configuration with Mixins
- Scoped Styling Components
- Styling Components with CSS Modules
- Summary
- 4. Interactions Between Components
- 5. Composition API
- 6. Incorporating External Data
- 7. Advanced Rendering, Dynamic Components, and Plugin Composition
- 8. Routing
-
9. State Management with Pinia
- Understanding State Management in Vue
- Understanding Pinia
- Creating a Pizzas Store for Pizza House
- Creating a Cart Store for Pizza House
- Using the Cart Store in a Component
- Adding Items to the Cart from the Pizzas Gallery
- Displaying Cart Items with Actions
- Removing Items from the Cart Store
- Unit Testing Pinia Stores
- Subscribing Side Effects on Store Changes
- Summary
- 10. Transitioning and Animation in Vue
-
11. Testing in Vue
- Introduction to Unit Testing and E2E Testing
- Vitest as a Unit Testing Tool
- Configuring Vitest Using Parameters and Config File
- Writing Your First Test
- Testing Non-Lifecycle Composables
- Testing Composables with Lifecycle Hook
- Testing Components Using Vue Test Utils
- Testing Interaction and Events of a Component
- Using Vitest with a GUI
- Using Vitest with a Coverage Runner
- End-to-End Testing with PlaywrightJS
- Debugging E2E Tests Using Playwright Test Extension for VSCode
- Summary
- 12. Continuous Integration/Continuous Deployment of Vue.Js Applications
- 13. Server-Side Rendering with Vue
- Index
- About the Author
Product information
- Title: Learning Vue
- Author(s):
- Release date: December 2023
- Publisher(s): O'Reilly Media, Inc.
- ISBN: 9781492098829
You might also like
book
Learning Go
Go is rapidly becoming the preferred language for building web services. While there are plenty of …
book
Learning Domain-Driven Design
Building software is harder than ever. As a developer, you not only have to chase ever-changing …
book
Learning React, 2nd Edition
If you want to learn how to build efficient React applications, this is your book. Ideal …
book
Building Micro-Frontends
What's the answer to today's increasingly complex web applications? Micro-frontends. Inspired by the microservices model, this …