File: async-edge-cases.html

package info (click to toggle)
vue.js 2.6.12%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 5,124 kB
  • sloc: javascript: 80,436; sh: 97; makefile: 7
file content (53 lines) | stat: -rw-r--r-- 1,142 bytes parent folder | download | duplicates (3)
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
46
47
48
49
50
51
52
53
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title></title>
    <script src="../../../dist/vue.min.js"></script>
  </head>
  <body>
    <!-- #4510 click and change event on checkbox -->
    <div id="case-1">
      <div @click="num++">
        {{ num }}
        <input type="checkbox" v-model="checked">
      </div>
    </div>
    <script>
    var vm1 = new Vue({
      el: '#case-1',
      data: {
        num: 1,
        checked: false
      }
    })
    </script>

    <!-- #6566 click event bubbling -->
    <div id="case-2">
      <div class="panel" v-if="expand">
        <button @click="expand = false, countA++">Expand is True</button>
      </div>
      <div class="header" v-if="!expand" @click="expand = true, countB++">
        <button>Expand is False</button>
      </div>
      <div class="count-a">
        countA: {{countA}}
      </div>
      <div class="count-b">
        countB: {{countB}}
      </div>
    </div>
    <script>
    var vm2 = new Vue({
      el: '#case-2',
      data: {
        expand: true,
        countA: 0,
        countB: 0,
      }
    })
    </script>

  </body>
</html>