O'Reilly logo

The Majesty of Vue.js by Kostas Maniatis, Alex Kyriakidis

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Event modifiers

Now we will move on and create a Calculator app. To do so, we'll use a form with two inputs and one drop-down to select the desired operation.

Even though the following code seems fine, our Calculator does not work as expected:

<html> <head> <title>Calculator</title>     <link href="https://maxcdn.bootstrapcdn.com/bootstrap\ /3.3.6/css/bootstrap.min.css" rel="stylesheet"> </head> <body>     <div class="container">         <h1>Type 2 numbers and choose operation.</h1>         <form class="form-inline">             <!-- Notice here the special attribute 'number'             is passed in order to parse inputs as numbers.-->             <input v-model="a" number class="form-control">             <select v-model="operator" class="form-control"> ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required