Blame view

examples/routers/circle.vue 1.19 KB
b2d29401   梁灏   support Circle
1
  <template>
b40e2e96   梁灏   Circle add prop d...
2
3
4
5
6
7
8
9
10
11
      <div>
          <i-circle :percent="percent" dashboard :stroke-color="color">
              <Icon v-if="percent == 100" type="ios-checkmark" size="60" style="color:#5cb85c"></Icon>
              <span v-else style="font-size:24px">{{ percent }}%</span>
          </i-circle>
          <ButtonGroup size="large">
              <Button icon="ios-add" @click="add"></Button>
              <Button icon="ios-remove" @click="minus"></Button>
          </ButtonGroup>
      </div>
b2d29401   梁灏   support Circle
12
13
14
  </template>
  <script>
      export default {
b40e2e96   梁灏   Circle add prop d...
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
          data () {
              return {
                  percent: 0
              }
          },
          computed: {
              color () {
                  let color = '#2db7f5';
                  if (this.percent == 100) {
                      color = '#5cb85c';
                  }
                  return color;
              }
          },
          methods: {
              add () {
                  if (this.percent >= 100) {
                      return false;
                  }
                  this.percent += 10;
              },
              minus () {
                  if (this.percent <= 0) {
                      return false;
                  }
                  this.percent -= 10;
              }
          }
b2d29401   梁灏   support Circle
43
44
      }
  </script>