Blame view

examples/routers/badge.vue 921 Bytes
15368be1   梁灏   Support Badge
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
  <style scoped>
      .demo-badge{
          width: 42px;
          height: 42px;
          background: #eee;
          border-radius: 6px;
          display: inline-block;
      }
  </style>
  <style>
      .demo-badge-alone{
          background: #5cb85c !important;
      }
  </style>
  <template>
      <div>
fdafcd2c   梁灏   Badge add text prop
17
          <Badge :count="count">
15368be1   梁灏   Support Badge
18
19
              <a href="#" class="demo-badge"></a>
          </Badge>
1ca07948   xiaofengsha   增加Badge组件showZero...
20
21
22
          <Badge :count="0" showZero>
              <a href="#" class="demo-badge"></a>
          </Badge>
75c32564   Aresn   fixed #646
23
          <Button @click="setCount">set count</Button>
fdafcd2c   梁灏   Badge add text prop
24
25
26
27
          <br><br>
          <Badge text="hot">
              <Button type="ghost">Hello</Button>
          </Badge>
15368be1   梁灏   Support Badge
28
29
30
31
32
33
      </div>
  </template>
  <script>
      export default {
          props: {},
          data () {
75c32564   Aresn   fixed #646
34
              return {
fdafcd2c   梁灏   Badge add text prop
35
                  count: 5
75c32564   Aresn   fixed #646
36
              };
15368be1   梁灏   Support Badge
37
          },
75c32564   Aresn   fixed #646
38
39
40
41
42
          methods: {
              setCount () {
                  this.count = 10;
              }
          }
15368be1   梁灏   Support Badge
43
44
      };
  </script>