Blame view

examples/routers/tag.vue 4.12 KB
382c000c   梁灏   Tag add type prop...
1
  <template>
456daf34   梁灏   support Tag
2
      <div>
855d4940   梁灏   Tag add more colo...
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
          <div>
              <Tag color="default">default</Tag>
              <Tag color="primary">primary</Tag>
              <Tag color="success">success</Tag>
              <Tag color="error">error</Tag>
              <Tag color="warning">warning</Tag>
              <Tag color="magenta">magenta</Tag>
              <Tag color="red">red</Tag>
              <Tag color="volcano">volcano</Tag>
              <Tag color="orange">orange</Tag>
              <Tag color="gold">gold</Tag>
              <Tag color="gold">不错</Tag>
              <Tag color="lime">lime</Tag>
              <Tag color="green">green</Tag>
              <Tag color="cyan">cyan</Tag>
              <Tag color="blue">blue</Tag>
              <Tag color="geekblue">geekblue</Tag>
              <Tag color="purple">purple</Tag>
              <Tag color="white">purple</Tag>
          </div>
2079c47b   梁灏   update Tag
23
24
25
26
27
28
29
30
31
          <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>
855d4940   梁灏   Tag add more colo...
32
33
34
35
          <Tag closable color="primary" checkable>标签一</Tag>
          <Tag closable color="success" checkable>标签二</Tag>
          <Tag closable color="error" checkable>标签三</Tag>
          <Tag closable color="warning" checkable>标签四</Tag>
2079c47b   梁灏   update Tag
36
          <br><br>
855d4940   梁灏   Tag add more colo...
37
38
39
40
          <Tag color="primary" checkable>标签一</Tag>
          <Tag color="success" checkable>标签二</Tag>
          <Tag color="error" checkable>标签三</Tag>
          <Tag color="warning" checkable>标签四</Tag>
2a6f6058   zhigang.li   fixed the bug abo...
41
          <br><br>
7d4b325b   zhigang.li   close #2406
42
          <Tag closable color="#EF6AFF" checkable>标签一</Tag>
2a6f6058   zhigang.li   fixed the bug abo...
43
          <Tag color="#EF6AFF" checkable>标签一</Tag>
7d4b325b   zhigang.li   close #2406
44
45
46
47
          <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
48
49
50
51
52
          <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>
855d4940   梁灏   Tag add more colo...
53
54
55
56
          <Tag type="border" closable color="primary" checkable>标签一</Tag>
          <Tag type="border" closable color="success">标签二</Tag>
          <Tag type="border" closable color="error">标签三</Tag>
          <Tag type="border" closable color="warning">标签四</Tag>
2079c47b   梁灏   update Tag
57
          <br><br>
855d4940   梁灏   Tag add more colo...
58
59
60
61
          <Tag type="dot" closable color="primary" checkable>标签一</Tag>
          <Tag type="dot" closable color="success">标签二</Tag>
          <Tag type="dot" closable color="error">标签三</Tag>
          <Tag type="dot" closable color="warning">标签四</Tag>
2079c47b   梁灏   update Tag
62
63
64
          <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>
5776bcbf   梁灏   fix #4587
65
66
67
68
69
70
71
  
          <br><br><hr><br>
          <Tag :checked="checked" checkable>test</Tag>
          <Button @click="toggle">
              Toggle
            </Button>
          <span>{{ checked }}</span>
df0d7bd9   梁灏   fix #5194 , close...
72
73
          <br><br>
          <Tag type="dot" color="gold">标签四</Tag>
456daf34   梁灏   support Tag
74
      </div>
382c000c   梁灏   Tag add type prop...
75
76
  </template>
  <script>
382c000c   梁灏   Tag add type prop...
77
      export default {
3e855e34   梁灏   fixed #46
78
79
          data () {
              return {
2079c47b   梁灏   update Tag
80
                  show: true,
5776bcbf   梁灏   fix #4587
81
82
                  count: [0, 1, 2],
                  checked: true
dc39cc31   daiyanze   Feature: Checkabl...
83
              };
3c01d81a   梁灏   fixed Modal bug,w...
84
85
          },
          methods: {
2079c47b   梁灏   update Tag
86
87
              handleClose () {
                  this.show = false;
dc39cc31   daiyanze   Feature: Checkabl...
88
              },
2079c47b   梁灏   update Tag
89
90
91
92
93
94
95
96
97
98
              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);
5776bcbf   梁灏   fix #4587
99
100
101
              },
              toggle() {
                  this.checked = !this.checked;
3e855e34   梁灏   fixed #46
102
103
              }
          }
dc39cc31   daiyanze   Feature: Checkabl...
104
      };
382c000c   梁灏   Tag add type prop...
105
  </script>