[Ebooks PDF] download Building web applications with Vue.js: MVVM patterns for conventional and single-page websites Ralph Steyer full chapters
[Ebooks PDF] download Building web applications with Vue.js: MVVM patterns for conventional and single-page websites Ralph Steyer full chapters
com
https://ebookmeta.com/product/building-web-applications-
with-vue-js-mvvm-patterns-for-conventional-and-single-page-
websites-ralph-steyer/
OR CLICK BUTTON
DOWNLOAD NOW
https://ebookmeta.com/product/building-progressive-web-applications-
with-vue-js-1st-edition-carlos-rojas/
ebookmeta.com
https://ebookmeta.com/product/single-page-web-applications-1st-
edition-michael-s-mikowski-josh-c-powell/
ebookmeta.com
https://ebookmeta.com/product/the-borgia-portrait-1st-edition-david-
hewson/
ebookmeta.com
Technology, Tradition and the State in Africa 1st Edition
Jack Goody
https://ebookmeta.com/product/technology-tradition-and-the-state-in-
africa-1st-edition-jack-goody/
ebookmeta.com
https://ebookmeta.com/product/discovering-deciphering-and-
dissenting-1st-edition-james-k-aitken/
ebookmeta.com
https://ebookmeta.com/product/signal-integrity-applied-
electromagnetics-and-professional-practice-2nd-edition-samuel-h-russ/
ebookmeta.com
https://ebookmeta.com/product/reordering-adivasi-worlds-
representation-resistance-memory-1st-edition-sangeeta-dasgupta/
ebookmeta.com
https://ebookmeta.com/product/selling-public-policy-rhetoric-
heresthetic-ethics-and-evidence-1st-edition-joseph-drew/
ebookmeta.com
Wolf Reborn Wolf Reborn 1 1st Edition Sara Snow
https://ebookmeta.com/product/wolf-reborn-wolf-reborn-1-1st-edition-
sara-snow-2/
ebookmeta.com
Ralph Steyer
This work is subject to copyright. All rights are solely and exclusively
licensed by the Publisher, whether the whole or part of the material is
concerned, specifically the rights of translation, reprinting, reuse of
illustrations, recitation, broadcasting, reproduction on microfilms or in
any other physical way, and transmission or information storage and
retrieval, electronic adaptation, computer software, or by similar or
dissimilar methodology now known or hereafter developed.
The publisher, the authors and the editors are safe to assume that the
advice and information in this book are believed to be true and accurate
at the date of publication. Neither the publisher nor the authors or the
editors give a warranty, expressed or implied, with respect to the
material contained herein or for any errors or omissions that may have
been made. The publisher remains neutral with regard to jurisdictional
claims in published maps and institutional affiliations.
This Springer imprint is published by the registered company Springer
Fachmedien Wiesbaden GmbH, part of Springer Nature.
The registered company address is: Abraham-Lincoln-Str. 46, 65189
Wiesbaden, Germany
Preface
Of course, the Internet is still on everyone’s lips. Digitization in general
is one of the most used “buzzwords” – especially by politicians, media
people, and decision makers. But the times of static websites are largely
over. While it was common a few years ago that at least simple websites
of private persons or smaller associations still used pure HTML code
(Hypertext Markup Language), such antiquated websites can be found
less and less nowadays. Usually at least content management systems
(CMS) like WordPress, Joomla!, Typo, or Drupal are used or such
websites are at least spiced up with stylesheets and/or JavaScript.
But if you are not satisfied with these 08/15 solutions of the
common CMS or if they do not (cannot) meet the required
requirements, the only option is the real programming of websites or
even Web applications. On the one hand, this path usually begins with
programming on the Web server side, including downstream database
systems, but on the other hand, modern websites or Web applications
must also be programmed in the client (the browser).
And in the browser, only JavaScript has been available for years as a
universally available technology for programming. Together with HTML
and CSS (Cascading Style Sheets), JavaScript forms the triad of modern
websites and especially of client-side Web programming.
Now JavaScript has been around for a very long time on the Web,
but for most years it was completely underestimated and dismissed as
a primitive beginner’s language. Only in the last few years have we
realized what a treasure JavaScript is for efficient and powerful
programming and that this language is anything but a beginner’s
language – even if you can learn it quickly as a beginner. Quite the
contrary. But you have to be able to use it professionally, because in
contrast to all-round carefree programming worlds from the .NET and
Java environment, which have “softened” programmers over the years
by hardly allowing them to make mistakes, you can’t expect such
protective mechanisms in JavaScript. Efficient and secure programming
with JavaScript requires skills from the programmer instead of
transferring them to IDEs (Integrated Development Environment) and
runtime environments. But this also makes JavaScript much leaner and
more efficient than its now hopelessly overloaded competitors.
Professional, efficient, and secure programming with JavaScript
therefore requires immense programming experience. Already in the
client, but even more so on the server side, where JavaScript has
meanwhile also begun its triumphant march. JavaScript is like a scalpel.
In the hands of an experienced surgeon, you can perform miracles with
it. In the hands of a layman or someone not working carefully, it can do
immense damage. Where JavaScript manages the balancing act of still
being easy to use by beginners for simple tasks. In my JavaScript
trainings, I hear again and again that many participants have already
used JavaScript. Mostly they copied existing scripts and adapted them if
necessary or wrote very simple scripts themselves and built them into
HTML pages. And that usually works, although almost always the
addition of the participants was that they did not really know why it
works.
The many frameworks that have established themselves in the Web
environment in recent years use some fundamentally different
approaches. But most frameworks often try to extend JavaScript by
things that are not possible with the core version. This makes it easier
to work with JavaScript and also provides possibilities that are not or
not easily available with pure JavaScript.
The various frameworks take very different approaches to
ultimately end up with the same result in the code that reaches the
user, namely a conglomerate of HTML, CSS, and JavaScript. Of course,
always connected with resources such as images, videos, audios, and
the like.
Now, Vue.js is an increasingly popular framework on the Web that
takes a very specific approach. It is a reactive, client-side JavaScript
Web framework that is essentially used to create so-called single-screen
Web applications or single-page Web applications (only one Web page
in the browser that updates parts as needed and does not reload a new
Web page) according to a Model-View-Controller pattern (MVC). Strictly
speaking, a Model-View-Controller pattern (MVVC) is used. But you can
definitely create Web applications and Web pages with it.
Vue.js is both easy to learn and very extensible and customizable. To
be able to learn Vue.js successfully, a good knowledge of HTML and
JavaScript is sufficient, as well as CSS if possible, which I would also like
to assume in the book. The developers of Vue.js call the framework
“progressive.” This essentially means that it can be used as much for
small improvements to individual details of the website as for larger
projects. It also supports the creation of reusable components. Another
advantage of Vue.js is that it does not require a complex installation and
can even be used entirely without installation “from the cloud” (from a
CDN content delivery network) if required.
So, follow me into the fascinating world of Vue.js!
Ralph Steyer
Bodenheim, Deutschland
Spring/Summer 2019
Contents
1 Introduction:Before the Real Thing Starts
1.1 What Do We Cover in the Introductory Chapter?
1.2 The Aim of the Book
1.3 What Should You Already Be Able to Do?
1.4 What Do You Need to Work with the Book?
1.4.1 The Vue.js Framework
1.5 The Features of Vue.js
1.5.1 Directives
1.5.2 The Virtual DOM
1.5.3 Data Binding and Reactivity
1.5.4 Creation of Components
1.5.5 An Own Event System
1.5.6 Animation and Transition Effects
1.5.7 Calculated Properties
1.5.8 Templates
1.5.9 Watcher
1.5.10 Routing
1.5.11 Vue CLI
1.6 Summary
2 First Examples:Just Test Vue.js Once
2.1 What Do We Cover in the Chapter?
2.2 The Basic Framework and a First Example
2.3 Dynamics for the Example
2.3.1 Real Response and v-model
2.4 Summary
3 Behind the Scenes:How and Why Does Vue.js Work?
3.1 What Do We Cover in This Chapter?
3.2 The Principle of Fault Tolerance and the DOM Concept
3.2.1 The DOM Concept From a Particular Point of View
3.3 Arrays, Objects and JSON
3.3.1 Hash Lists
3.3.2 The JavaScript Object Notation
3.3.3 Callbacks and Function References
3.4 MVC and MVVC
3.4.1 Design Patterns
3.4.2 The MVC Pattern
3.4.3 MVVC
3.5 Summary
4 Vue.js in Depth:The Vue Instance, Vue Templates, and Data
Binding
4.1 What Do We Cover in the Chapter?
4.2 The Vue Instance
4.2.1 Responding to the Creation of the Vue Object: The Life
Cycle
4.3 Basic Information About Vue.js Templates
4.3.1 The Template Attribute
4.3.2 Under the Template Hood
4.3.3 Different Types of Data Binding in Templates
4.3.4 Using JavaScript Expressions for Data Binding
4.4 More on Directives
4.4.1 Arguments
4.4.2 Dynamic Arguments
4.4.3 Restrictions for Dynamic Argument Values
4.4.4 Modifiers for Attributes
4.5 Components
4.5.1 Watch Out!
4.5.2 Global Versus Local Registration
4.5.3 Data Transfer
4.5.4 The Way Back:Slots
4.5.5 Asynchronous Data Transmission
4.5.6 Single File Components
4.6 Which Side Would You Like to Have?Routing
4.6.1 MVVC/MVC and Routing
4.6.2 The Concrete Implementation in Vue.js
4.7 Summary
5 Working with Arrays:Iterations with the v-for Directive
5.1 What Do We Cover in the Chapter?
5.2 The v-for Directive
5.2.1 Static Display of Values From an Array
5.2.2 Access to the Index of the Current Element
5.3 Access to More Complex Structures
5.3.1 Nested v-for Directives
5.3.2 Addressing Individual Entries Directly
5.4 Specific Applications of the v-for Directive
5.4.1 The v-for Directive with a Range of Values
5.4.2 Access to the Parent Elements
5.4.3 Key and Index in One Object
5.4.4 The Key Attribute for Binding the Id
5.4.5 Calling Callbacks
5.5 Observing Changes in Arrays
5.5.1 Mutating Methods
5.5.2 Sorting Arrays and Working with Methods
5.5.3 Generating New Arrays
5.6 Summary
6 Conditional Rendering:The v-if Directive – Making Decisions
6.1 What Do We Cover in the Chapter?
6.2 The v-if, v-else and v-else-if Directives
6.3 The v-show Directive
6.4 When v-if and When v-show?
6.5 A Special Combination:The Directive v-for with v-if or v-
show
6.5.1 A Wrapper with v-if is Better
6.6 Summary
7 Events, Methods, Observers and Calculated Properties:
Calculated Results and Reactions
7.1 What Do We Cover in the Chapter?
7.2 Basic Considerations on the Distribution of Tasks
7.3 Methods of a Vue Object and the Methods Property
7.4 The Event Handling in Vue.js
7.4.1 Background to Event Handling
7.4.2 The Concrete Example of v-on
7.4.3 Evaluating the Event object
7.4.4 Event Modifier
7.4.5 Other Modifiers
7.4.6 User-Defined Events
7.5 The Computed Property
7.6 When Methods and When Calculated Properties?
7.7 Watcher (Observer)
7.7.1 Observing the Geolocation with a Watcher
7.7.2 Ajax with a Watcher
7.8 Summary
8 Dynamic Layouts with Data Binding:Making Stylesheets
Dynamic
8.1 What Do We Cover in the Chapter?
8.2 Data Binding and the v-bind Directive for Conditional
Classes
8.2.1 Switching CSS Classes
8.2.2 The Array Notation for Multiple Properties
8.2.3 Logic in the HTML File
8.3 Data Binding and the v-bind Directive for Inline Styles
8.4 Abbreviations (Shorthands)
8.4.1 The v-bind Abbreviation
8.4.2 Abbreviation v-on
8.5 Summary
9 Forms and Form Data Binding:Interaction with the User
9.1 What Do We Cover in the Chapter?
9.2 Basics of Using Forms on the Web
9.2.1 The Contained Form Elements
9.3 Basic Use of Form Binding in Vue.js
9.3.1 Vue Instance First
9.4 Some Concrete Examples
9.4.1 A Simple Form with Different Form Elements
9.5 Dynamic Options
9.6 A Task List as a Practical Example
9.6.1 A First Simple Version of a Todo List
9.6.2 A Permanent Task List
9.6.3 Persistence the Second:Server-Side
9.7 More on Value Bindings for Forms
9.7.1 The Modifiers
9.8 Summary
10 Filtering Techniques:Selected Data Only
10.1 What Do We Cover in the Chapter?
10.2 Basics of Filters for JavaScript Arrays
10.2.1 The Arrow Notation
10.3 Filters in Vue.js
10.3.1 Local Filters
10.3.2 Global Filters by Extending the Vue Instance
10.3.3 Dynamic Filtering
10.3.4 Chaining Filters
10.3.5 Transfer to Parameters
10.4 Summary
11 Transitions and Animations:Moving Things
11.1 What Do We Cover in the Chapter?
11.2 Transitions with Transition
11.3 The Transition Classes
11.4 CSS Animations
11.5 Special Situations
11.5.1 Using Transitions and Animations Together
11.5.2 Explicit Transition Times:The Duration Specification
11.5.3 JavaScript Hooks
11.5.4 Animation of Data
11.6 Summary
12 Outlook:What Else Is There in Vue.js?
12.1 What Do We Cover in the Chapter?
12.2 Use Vue.js in CMS or in Combination with Other
Frameworks
12.3 Server-Side Rendering
12.4 Mixins
12.5 User-Defined Directives
12.6 Plugins
12.6.1 Using a Plugin
12.6.2 Writing a Plugin
12.7 Summary
Appendix
Index
List of Figures
Fig.1.1 The official website of Vue.js
Fig.2.5 The examples were spiced up a bit with CSS – here the third
example
Other documents randomly have
different content
The New Baby
(Written for Alfred Greene, Jr., Evansville, Indiana.)
When Alfred saw the baby wee the stork to him had
brought,
"Dear mother we must send this kid back to her home to-
day,
Then you and I'll be glad again and go to hear the band.
Woes Caused By Whooping Bugs
(Written for Cousin Harvey Stoner, Jr.)
And even when you're tired you can't sleep for the croup,
But you must stay at home ALONE from three to six long
weeks,
Said young Heiman to Simple Simon, "I will not selfish be,
There were bisque dolls and wax dolls and dolls with real
hair,
Red dolls and black dolls and dolls that were fair,
But though I love dear mother far more than all the rest,
And mother says perhaps this solves the very reason why
A la mode to be attired.
But when she rose on Easter morn
But one good giant's life was spared by this bold warrior
lad.
ARITHMOS was this giant great, and all bright girls and
boys
Should love the famous Giant-King far more than all their
toys.
He's very old, and very great, and also wondrous wise,
For he can count all things on earth and even tell their
size.
He knows how many birds there are; how high each bird
can fly,
'Tis he alone can tell you when a great eclipse will come
And darken the moon's lady or the old man in the sun.
He'll help us with our lessons hard when for his aid we
call,
And for his work and trouble never thinks to ask a penny.
We all should learn his wondrous truths and love him more
and more.
Good Weather Assured
(Written for the Evansville Courier, February 3, 1909.)
And eat farmers' crops 'neath the light o' the sun.
One day last week King Teddy arose with old King Sun,
But when Queen Lion heard his tale, she simply scratched
one ear,
Then shrugged her shoulders a la hump and to her
husband said,
Then brave and proud Queen Lion she carried out each
babe,
For of his teeth and of his gun she hadn't any fear.