Book Image

Vue.js 3 Cookbook

By : Heitor Ramon Ribeiro
Book Image

Vue.js 3 Cookbook

By: Heitor Ramon Ribeiro

Overview of this book

Vue.js is a progressive web framework for building professional user interfaces for your web applications. With Vue.js 3, the frontend framework is reinforced with architectural enhancements, new base languages, new render processes, and separated core components. The book starts with recipes for implementing Vue.js 3’s new features in your web development projects and migrating your existing Vue.js apps to the latest version. You will get up and running with TypeScript with Vue.js and find succinct solutions to common challenges and pitfalls faced in implementing components, derivatives, and animation, through to building plugins, adding state management, routing, and developing complete single-page applications (SPAs). As you advance, you'll discover recipes to help you integrate Vue.js apps with Nuxt.js in order to add server-side rendering capabilities to your SPAs. You'll then learn about the Vue.js ecosystem by exploring modern frameworks such as Quasar, Nuxt.js, Vuex, and Vuetify in your web projects. Finally, the book provides you with solutions for packaging and deploying your Vue.js apps. By the end of this Vue.js book, you'll be able to identify and solve challenges faced in building Vue.js applications and be able to adopt the Vue.js framework for frontend web projects of any scale.
Table of Contents (13 chapters)
Fetching Data from the Web via HTTP Requests
Managing Routes with vue-router
Managing the Application State with Vuex
Directives, Plugins, SSR, and More
Introducing TypeScript and the Vue Ecosystem

TypeScript is a new Vue-based language, fully supported on Vue 3. It is now possible to use typed JSX (also know as TSX), type annotation, static verification of the code, and much more.

The Vue ecosystem is getting bigger each day, so to help us, the Vue team has developed some tools to improve project handling and management. Those tools are Vue CLI and Vue UI, which today are the main tools for local Vue development.

The Vue CLI tool is the beginning of every project; with it, you will be able to select the basic features or just a preset you had made, to create a new Vue project. After a project is created, you can use Vue UI to manage the project, add new features, check the status of the project, and do almost everything you previously needed to do in the command-line interface (CLI), with the addition of more features.

In these chapters, you learn more about TypeScript as a superset on JavaScript and how to use the power of the Vue CLI tool and Vue UI together to get a whole application up and running.

In this chapter, we'll cover the following recipes:

  • Creating a TypeScript project
  • Understanding TypeScript
  • Creating your first TypeScript class
  • Creating your first project with Vue CLI
  • Adding plugins to a Vue CLI project with Vue UI
  • Adding TypeScript to a Vue CLI project
  • Creating your first TypeScript Vue component with vue-class-component
  • Creating a custom mixin with vue-class-component
  • Creating a custom function decorator with vue-class-component
  • Adding custom hooks to vue-class-component
  • Adding vue-property-decorator to vue-class-component