Files
  • index.html
  • index.css
  • index.js
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width">
    <title>repl.it</title>
    <link href="index.css" rel="stylesheet" type="text/css" />
    
  </head>
  <body>
    <form id="demo">
    <!-- text -->
    <p><input type="text" v-model="msg"> {{msg}}</p>
    <!-- checkbox -->
    <p><input type="checkbox" v-model="checked"> {{checked ? 'yes' : 'no'}}</p>
    <!-- radio buttons -->
    <p>
        <input type="radio" name="picked" value="one" v-model="picked">
        <input type="radio" name="picked" value="two" v-model="picked">
        {{picked}}
    </p>
    <!-- select -->
    <p>
        <select v-model="selected">
            <option>one</option>
            <option>two</option>
        </select>
        {{selected}}
    </p>
    <!-- multiple select -->
    <p>
        <select v-model="multiSelect" multiple>
            <option>one</option>
            <option>two</option>
            <option>three</option>
        </select>
        {{multiSelect}}
    </p>
    <p>data: {{$data}}</p>
    <p>${{checked ? (result - 5) : (result + 5)}}</p>
</form>
<script src="//cdnjs.cloudflare.com/ajax/libs/vue/0.10.6/vue.min.js"></script>
    <script src="index.js"></script>
  </body>
</html>
result
console