A Better Way To Learn Vue
A Better Way To Learn Vue
Book 1: The Basics
About the Book
In this no fluff book, we dive straight in to building apps in Vue.
In chapter 1, we build the smallest possible Vue app, and get to know about:
* How to mount a Vue app
* String interpolation and data in HTML
* Adding a Vue instance and its options object
Once we've learned the very basics of how Vue is put together, we build a simple todo app in Vue 2.6, in chapter 2. Through the building of this app, we learn new concepts and build on the existing ones:
* Using the v-bind directive to connect Vue data to HTML attributes
* Handling button clicks with v-on:click
* Handling input events with v-on:input , v-on:keyup , v-on:keydown
* Handling more than one keypress event
* Preventing default behavior with event modifiers
* Modelling our app’s data
* Using the v-for directive to loop over Vue’s data arrays
* Preventing page reload on the form element
* Adding a toggle button with text and style updates
* Mounting and unmounting HTML elements with v-if and v-else
* Binding a CSS class in HTML to our Vue instance’s data option and showing this CSS class
* Utilizing confirm popups in our apps
In Chapter 3, we introduce Vue CLI, and cover the following topics:
* How to install Vue on our machine,
* How to build a new Vue app using Vue CLI,
* How to serve our boilerplate Vue app in the browser,
* We inspected all the files and folders in the boilerplate Vue app that we installed using the
Vue CLI, and we discuss what they do and how they fit together
In Chapter 4, we have a sort of a revision of concepts from Chapters 1 and 2, but this time covered through the lens of working with Vue CLI, including:
* How to add a child component to our project
* How to interpolate string values from the data option of our Vue instance
* How to randomly pick and return string values from a method in the methods option of our
Vue instance, and interpolate that value in our single-file component’s template section
* How to bind a Vue instance’s data as a value of a template’s HTML attribute
* We also go through each file and folder in the starter app and describe why it's there and how it works
In Chapter 5, we learn about single-file components in a Vue app:
* Adding children components
* Revising interpolation (this time, in SFCs)
* Templating with values returned from methods
In Chapter 6, we discuss data flows in a Vue app:
* Sending data from the parent component to a child component
* Sending data from the child component to a parent component
* Emitting events with additional data
* We practice components' communication by building another Vue app
* We cover prop-related issues, such as naming conventions, using props in methods, fixing prop errors, passing props as various data types (prop binding)
In Chapter 7, we integrate a linting tool, ESLint, and a library, Bootstrap Vue, with our Vue CLI-powered Vue apps
* Revision of basic concepts: installing Vue, preparing VS Code to use it, installing the boilerplate Vue.js app with Vue CLI, removing redundant code from the starter app
* Setting up ESLint to work with Vue.js
* Styling our app with BootstrapVue
* Adding Vue Chrome extension
* Restarting our app (dealing with some weird errors)
In Chapter 8, we build the todo app again, this time with Vue CLI. This serves a double purpose:
* We revise all the concepts needed to build a todo app
* This chapter is a practical example on converting a non-Vue CLI app to a Vue CLI SFC Vue app. The insights you'll gain here are very valuable for a new Vue developer
In Chapter 9, another hands-on chapter, we continue working with the app we've built in Chapter 8, but this time we demo how to split a single file component into a component and a sub-component. We show the practical implementation of one-way data flow approach on an app that we're now quite familiar with, which helps us keep focus on understanding how to make our Vue apps more modular.
In Chapter 10, we "back-fill" our knowledge with some basic concepts that we've skipped in earlier chapters.
Chapter 1: The absolute basics
- The smallest possible Vue.js app
- String interpolation in Vue
- Data in HTML
- Adding a Vue instance
- A Vue instance’s options object
- A Vue instance’s options object’s data option
- Other options in the Vue instance’s options object
Chapter 2: Building a todo app in Vue
- Adding the static HTML
- Adding a Vue instance
- Adding a heading with Vue
- Letting Vue control the input’s placeholder string
- Handling button clicks with Vue
- Handling input events with Vue
- Handling keypress events with Vue
- Handling more than one keypress event with Vue
- Preventing default behavior with event modifiers
- Modelling our todo item data
- Vue’s version of a for loop (in HTML!)
Adding ordinal numbers using the
- Adding a new todo entry using two-way data binding
- Emitting input events
- Implementing two-way data binding in our todo app
Two-way binding shorthand syntax with
- Updating the list of todos in our unordered list
Preventing page reload on the
- Clearing all todos
- Adding a completed toggle button to each todo
- Using a v-if to mount HTML elements conditionally
- Erasing single todos
- Warn the user with a browser confirm popup
- Clear the input field whenever a user adds a todo
- Let’s review the full code of our todo app
Chapter 3: Convert a static HTML page to Vue
- Inspecting the source of our customized HTML layout
- Importing Vue and mounting it in the DOM
- Mounting a new instance of Vue
- Adding multiple Vue instances to our HTML layout
- Passing data to the cards section
- Avoiding the repetition with v-for
- Adding a bit more interactivity
- Affecting data in one Vue instance from another Vue instance
- Adding Bootstrap background classes
classattribute to a method call
Chapter 4: Build a Vue project with Vue CLI
- Installing Vue CLI
- Build a new project quickly with Vue CLI
- Review the structure of our app
- Stand-alone files at the very root of our Vue app
Chapter 5: Child components, data interpolation, and single file components
- 1. Adding children components
2. Templating: Interpolating values stored in the
3. Templating: Interpolating values returned from the
- We can’t interpolate strings inside HTML attributes
Chapter 6: Data flows in a Vue app
- 1. Sending data from the parent component to a child component
- 2. Sending data from the child component to a parent component
- Emitting events with additional data
- Practice: A message-passing app
- Prop as kebab-case or lowerCamelCase?
- Using props in methods
- Fixing the “Avoid mutating a prop directly” error
- Giving more information about our props with nested objects
- Passing props as data types other than “string”, and binding props with v-bind
- Making props more dynamic with v-bind and v-for
- Practicing the passing of data with emitted custom events
Chapter 7: Using Vue CLI with ES Lint and Bootstrap-Vue
1. Renaming the
HelloWorldcomponent to the
2. Adding and displaying data inside the
- 3. Setting up ESLint to work with Vue.js
- 4. Styling our app with BootstrapVue
- 5. Adding Vue Chrome extension
- 6. Adding a navigation component to our app
- 7. Restarting our app
- 1. Renaming the
Chapter 8: Building the Todo app again, this time with Vue CLI
- Prepping a brand new Vue app for Bootstrap-Vue
- 3. Add BootstrapVue to the app
- 4. Adding the form-input component
- Adding the button component
- Adding the clear all button
- Adding click events to buttons
- Displaying the todos array
- Adding the method to delete a single todo
- Toggling styles
Chapter 9: Splitting a Vue app into sub-components
- Splitting the
Chapter 10: Other important concepts for Vue.js beginners
- 1. Vue-specific shorthand syntax
2. Using the
- 3. Slots and named slots
- 4. Methods, computed properties, and watchers
- 9. The life-cycle of a Vue component
- 10. A Vue component’s life-cycle hooks
11. Accessing DOM nodes using the Vue-specific HTML
Chapter 11: Appendix A, the starter app
- 1. Installing Vue.js
- 2. Preparing VS Code for Vue
- 3. Installing the boilerplate Vue.js app with Vue CLI
- 4. Removing redundant code from our boilerplate Vue.js app
The Leanpub 45-day 100% Happiness Guarantee
Within 45 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
See full terms
Free Updates. DRM Free.
If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).
Most Leanpub books are available in PDF (for computers), EPUB (for phones and tablets) and MOBI (for Kindle). The formats that a book includes are shown at the top right corner of this page.
Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.
C++20 is the next big C++ standard after C++11. As C++11 did it, C++20 changes the way we program modern C++. This change is, in particular, due to the big four of C++20: ranges, coroutines, concepts, and modules.
The book is almost daily updated. These incremental updates ease my interaction with the proofreaders.
A Guide to Artificial Intelligence in HealthcareDr. Bertalan Mesko
Can we stay human in the age of A.I.? To go even further, can we grow in humanity, can we shape a more humane, more equitable and sustainable healthcare? This e-book aims to prepare healthcare and medical professionals for the era of human-machine collaboration. Read our guide to understanding, anticipating and controlling artificial intelligence.
Atomic KotlinBruce Eckel and Svetlana Isakova
For both beginning and experienced programmers! From the author of the multi-award-winning Thinking in C++ and Thinking in Java together with a member of the Kotlin language team comes a book that breaks the concepts into small, easy-to-digest "atoms," along with exercises supported by hints and solutions directly inside IntelliJ IDEA!
Introducing EventStormingAlberto Brandolini
The deepest tutorial and explanation about EventStorming, straight from the inventor.
C++ Best PracticesJason Turner
Level up your C++, get the tools working for you, eliminate common problems, and move on to more exciting things!
Ansible for DevOpsJeff Geerling
Ansible is a simple, but powerful, server and configuration management tool. Learn to use Ansible effectively, whether you manage one server—or thousands.
Everyday Rails - RSpecによるRailsテスト入門Junichi Ito (伊藤淳一), AKIMOTO Toshiharu, 魚振江, and Aaron Sumner
RSpecを使ってRailsアプリケーションに信頼性の高いテストを書く実践的なアドバイスを提供します。詳細で丁寧な説明は本書のオリジナルコンテンツです。また、説明には実際に動かせるサンプルアプリケーションも使用します。本書は2017年版にアップデートされ、RSpec 3.6やRails 5.1といった新しい環境に対応しています！さあ、自信をもってテストできるようになりましょう！
The Hundred-Page Machine Learning BookAndriy Burkov
Everything you really need to know in Machine Learning in a hundred pages.
Composing SoftwareEric Elliott
All software design is composition: the act of breaking complex problems down into smaller problems and composing those solutions. Most developers have a limited understanding of compositional techniques. It's time for that to change.
R Programming for Data ScienceRoger D. Peng
This book brings the fundamentals of R programming to you, using the same material developed as part of the industry-leading Johns Hopkins Data Science Specialization. The skills taught in this book will lay the foundation for you to begin your journey learning data science. Printed copies of this book are available through Lulu.
Software Architecture for Developers: Volumes 1 & 2 - Technical leadership and communication
2 Books"Software Architecture for Developers" is a practical and pragmatic guide to modern, lightweight software architecture, specifically aimed at developers. You'll learn:The essence of software architecture.Why the software architecture role should include coding, coaching and collaboration.The things that you really need to think about before...
All the Books of The Medical Futurist
6 BooksWe put together the most popular books from The Medical Futurist to provide a clear picture about the major trends shaping the future of medicine and healthcare. Digital health technologies, artificial intelligence, the future of 20 medical specialties, big pharma, data privacy, digital health investments and how technology giants such as Amazon...
Cisco CCNA 200-301 Complet
4 BooksCe lot comprend les quatre volumes du guide préparation à l'examen de certification Cisco CCNA 200-301.
Linux Administration Complet
4 BooksCe lot comprend les quatre volumes du Guide Linux Administration :Linux Administration, Volume 1, Administration fondamentale : Guide pratique de préparation aux examens de certification LPIC 1, Linux Essentials, RHCSA et LFCS. Administration fondamentale. Introduction à Linux. Le Shell. Traitement du texte. Arborescence de fichiers. Sécurité...
Learn Git, Bash, and Terraform the Hard Way
3 BooksLearn Git, Bash and Terraform using the Hard Way method.These technologies are essential tools in the DevOps armoury. These books walk you through their features and subtleties in a simple, gradual way that reinforces learning rather than baffling you with theory.
3 BooksBuy every PowerShell book from Adam Bertram at a 20% discount!
Software Architecture and Beautiful APIs
2 BooksThere is no better way to learn how to design good APIs than to look at many existing examples, complementing the Software Architecture theory on API design.
9 Books-Bundle: Shut Up and Code!
9 Books"Shut up and code." Laughter in the audience. The hacker had just plugged in his notebook and started sharing his screen to present his super-smart Python script. "Shut up and code" The letters written in a white literal coding font on black background was the hackers' home screen background mantra. At the time, I was a first-year computer...
CCDE Practical Studies (All labs)
3 BooksCCDE lab
Modern C++ by Nicolai Josuttis