Blame view

examples/routers/tag.vue 2.92 KB
382c000c   梁灏   Tag add type prop...
1
  <template>
456daf34   梁灏   support Tag
2
      <div>
2079c47b   梁灏   update Tag
3
4
5
6
7
8
9
10
11
12
13
14
15
16
          <Tag checkable>标签一</Tag>
          <Tag>标签二</Tag>
          <Tag v-if="show" closable @on-close="handleClose">标签三</Tag>
          <br><br>
          <Tag type="border" checkable>标签三</Tag>
          <Tag type="border" closable>标签四</Tag>
          <Tag type="dot">标签一</Tag>
          <Tag type="dot" closable>标签二</Tag>
          <br><br>
          <Tag closable color="blue" checkable>标签一</Tag>
          <Tag closable color="green" checkable>标签二</Tag>
          <Tag closable color="red" checkable>标签三</Tag>
          <Tag closable color="yellow" checkable>标签四</Tag>
          <br><br>
2a6f6058   zhigang.li   fixed the bug abo...
17
18
19
20
21
          <Tag color="blue" checkable>标签一</Tag>
          <Tag color="green" checkable>标签二</Tag>
          <Tag color="red" checkable>标签三</Tag>
          <Tag color="yellow" checkable>标签四</Tag>
          <br><br>
7d4b325b   zhigang.li   close #2406
22
          <Tag closable color="#EF6AFF" checkable>标签一</Tag>
2a6f6058   zhigang.li   fixed the bug abo...
23
          <Tag color="#EF6AFF" checkable>标签一</Tag>
7d4b325b   zhigang.li   close #2406
24
25
26
27
          <Tag type="border" closable color="#EF6AFF" checkable>标签二</Tag>
          <Tag type="dot" closable color="#EF6AFF" checkable>标签三</Tag>
          <Tag closable color="default" checkable>标签四</Tag>
          <br><br>
3f7a5f1a   zhigang.li   udpate notice
28
29
30
31
32
          <Tag closable color="#EF6AFF">标签一</Tag>
          <Tag type="border" closable color="#EF6AFF">标签二</Tag>
          <Tag type="dot" closable color="#EF6AFF">标签三</Tag>
          <Tag closable color="default">标签四</Tag>
          <br><br>
2079c47b   梁灏   update Tag
33
34
35
36
37
38
39
40
41
42
43
44
          <Tag type="border" closable color="blue" checkable>标签一</Tag>
          <Tag type="border" closable color="green">标签二</Tag>
          <Tag type="border" closable color="red">标签三</Tag>
          <Tag type="border" closable color="yellow">标签四</Tag>
          <br><br>
          <Tag type="dot" closable color="blue" checkable>标签一</Tag>
          <Tag type="dot" closable color="green">标签二</Tag>
          <Tag type="dot" closable color="red">标签三</Tag>
          <Tag type="dot" closable color="yellow">标签四</Tag>
          <br><br>
          <Tag v-for="item in count" :key="item" :name="item" closable @on-close="handleClose2">标签{{ item + 1 }}</Tag>
          <Button icon="ios-plus-empty" type="dashed" size="small" @click="handleAdd">添加标签</Button>
456daf34   梁灏   support Tag
45
      </div>
382c000c   梁灏   Tag add type prop...
46
47
  </template>
  <script>
382c000c   梁灏   Tag add type prop...
48
      export default {
3e855e34   梁灏   fixed #46
49
50
          data () {
              return {
2079c47b   梁灏   update Tag
51
52
                  show: true,
                  count: [0, 1, 2]
dc39cc31   daiyanze   Feature: Checkabl...
53
              };
3c01d81a   梁灏   fixed Modal bug,w...
54
55
          },
          methods: {
2079c47b   梁灏   update Tag
56
57
              handleClose () {
                  this.show = false;
dc39cc31   daiyanze   Feature: Checkabl...
58
              },
2079c47b   梁灏   update Tag
59
60
61
62
63
64
65
66
67
68
              handleAdd () {
                  if (this.count.length) {
                      this.count.push(this.count[this.count.length - 1] + 1);
                  } else {
                      this.count.push(0);
                  }
              },
              handleClose2 (event, name) {
                  const index = this.count.indexOf(name);
                  this.count.splice(index, 1);
3e855e34   梁灏   fixed #46
69
70
              }
          }
dc39cc31   daiyanze   Feature: Checkabl...
71
      };
382c000c   梁灏   Tag add type prop...
72
  </script>