Skip to content

Commit 93cf802

Browse files
committed
feat: update tag
1 parent c816086 commit 93cf802

File tree

12 files changed

+85
-102
lines changed

12 files changed

+85
-102
lines changed

build/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module.exports = {
22
dev: {
3-
componentName: 'tree', // dev components
3+
componentName: 'tag', // dev components
44
},
55
};

components/tag/Tag.jsx

Lines changed: 39 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,27 @@ import Icon from '../icon';
33
import getTransitionProps from '../_util/getTransitionProps';
44
import omit from 'omit.js';
55
import Wave from '../_util/wave';
6-
import { hasProp, getListeners } from '../_util/props-util';
6+
import { hasProp, getListeners, getOptionProps } from '../_util/props-util';
77
import BaseMixin from '../_util/BaseMixin';
88
import { ConfigConsumerProps } from '../config-provider';
9+
import warning from '../_util/warning';
10+
11+
const PresetColorTypes = [
12+
'pink',
13+
'red',
14+
'yellow',
15+
'orange',
16+
'cyan',
17+
'green',
18+
'blue',
19+
'purple',
20+
'geekblue',
21+
'magenta',
22+
'volcano',
23+
'gold',
24+
'lime',
25+
];
26+
const PresetColorRegex = new RegExp(`^(${PresetColorTypes.join('|')})(-inverse)?$`);
927

1028
export default {
1129
name: 'ATag',
@@ -26,9 +44,15 @@ export default {
2644
},
2745
data() {
2846
let _visible = true;
29-
if (hasProp(this, 'visible')) {
47+
const props = getOptionProps(this);
48+
if ('visible' in props) {
3049
_visible = this.visible;
3150
}
51+
warning(
52+
!('afterClose' in props),
53+
'Tag',
54+
"'afterClose' will be deprecated, please use 'close' event, we will remove this in the next version.",
55+
);
3256
return {
3357
_visible,
3458
};
@@ -44,6 +68,11 @@ export default {
4468
setVisible(visible, e) {
4569
this.$emit('close', e);
4670
this.$emit('close.visible', false);
71+
const afterClose = this.afterClose;
72+
if (afterClose) {
73+
// next version remove.
74+
afterClose();
75+
}
4776
if (e.defaultPrevented) {
4877
return;
4978
}
@@ -53,35 +82,28 @@ export default {
5382
},
5483

5584
handleIconClick(e) {
85+
e.stopPropagation();
5686
this.setVisible(false, e);
5787
},
5888

59-
animationEnd() {
60-
const afterClose = this.afterClose;
61-
if (afterClose) {
62-
afterClose();
63-
}
64-
},
65-
66-
isPresetColor(color) {
89+
isPresetColor() {
90+
const { color } = this.$props;
6791
if (!color) {
6892
return false;
6993
}
70-
return /^(pink|red|yellow|orange|cyan|green|blue|purple|geekblue|magenta|volcano|gold|lime)(-inverse)?$/.test(
71-
color,
72-
);
94+
return PresetColorRegex.test(color);
7395
},
7496
getTagStyle() {
7597
const { color } = this.$props;
76-
const isPresetColor = this.isPresetColor(color);
98+
const isPresetColor = this.isPresetColor();
7799
return {
78100
backgroundColor: color && !isPresetColor ? color : undefined,
79101
};
80102
},
81103

82104
getTagClassName(prefixCls) {
83105
const { color } = this.$props;
84-
const isPresetColor = this.isPresetColor(color);
106+
const isPresetColor = this.isPresetColor();
85107
return {
86108
[prefixCls]: true,
87109
[`${prefixCls}-${color}`]: isPresetColor,
@@ -101,19 +123,18 @@ export default {
101123
const prefixCls = getPrefixCls('tag', customizePrefixCls);
102124
const { _visible: visible } = this.$data;
103125
const tag = (
104-
<div
126+
<span
105127
v-show={visible}
106128
{...{ on: omit(getListeners(this), ['close']) }}
107129
class={this.getTagClassName(prefixCls)}
108130
style={this.getTagStyle()}
109131
>
110132
{this.$slots.default}
111133
{this.renderCloseIcon()}
112-
</div>
134+
</span>
113135
);
114136
const transitionProps = getTransitionProps(`${prefixCls}-zoom`, {
115137
appear: false,
116-
afterLeave: this.animationEnd,
117138
});
118139
return (
119140
<Wave>

components/tag/__tests__/__snapshots__/demo.test.js.snap

Lines changed: 14 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,6 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

3-
exports[`renders ./components/tag/demo/basic.md correctly 1`] = `
4-
<div>
5-
<div class="ant-tag">Tag 1</div>
6-
<div class="ant-tag"><a href="https://github.com/vueComponent/ant-design">Link</a></div>
7-
<div class="ant-tag">Tag 2<i aria-label="icon: close" tabindex="-1" class="anticon anticon-close"><svg viewBox="64 64 896 896" data-icon="close" width="1em" height="1em" fill="currentColor" aria-hidden="true" focusable="false" class="">
8-
<path d="M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 0 0 203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"></path>
9-
</svg></i></div>
10-
<div class="ant-tag">Prevent Default<i aria-label="icon: close" tabindex="-1" class="anticon anticon-close"><svg viewBox="64 64 896 896" data-icon="close" width="1em" height="1em" fill="currentColor" aria-hidden="true" focusable="false" class="">
11-
<path d="M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 0 0 203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"></path>
12-
</svg></i></div>
13-
</div>
14-
`;
3+
exports[`renders ./components/tag/demo/basic.md correctly 1`] = `<div><span class="ant-tag">Tag 1</span> <span class="ant-tag"><a href="https://github.com/vueComponent/ant-design">Link</a></span> <span class="ant-tag">Tag 2<i aria-label="icon: close" tabindex="-1" class="anticon anticon-close"><svg viewBox="64 64 896 896" data-icon="close" width="1em" height="1em" fill="currentColor" aria-hidden="true" focusable="false" class=""><path d="M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 0 0 203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"></path></svg></i></span> <span class="ant-tag">Prevent Default<i aria-label="icon: close" tabindex="-1" class="anticon anticon-close"><svg viewBox="64 64 896 896" data-icon="close" width="1em" height="1em" fill="currentColor" aria-hidden="true" focusable="false" class=""><path d="M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 0 0 203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"></path></svg></i></span></div>`;
154

165
exports[`renders ./components/tag/demo/checkable.md correctly 1`] = `
176
<div>
@@ -24,60 +13,31 @@ exports[`renders ./components/tag/demo/checkable.md correctly 1`] = `
2413
exports[`renders ./components/tag/demo/colorful.md correctly 1`] = `
2514
<div>
2615
<h4 style="margin-bottom: 16px;">Presets:</h4>
27-
<div>
28-
<div class="ant-tag ant-tag-pink">pink</div>
29-
<div class="ant-tag ant-tag-red">red</div>
30-
<div class="ant-tag ant-tag-orange">orange</div>
31-
<div class="ant-tag ant-tag-green">green</div>
32-
<div class="ant-tag ant-tag-cyan">cyan</div>
33-
<div class="ant-tag ant-tag-blue">blue</div>
34-
<div class="ant-tag ant-tag-purple">purple</div>
35-
</div>
16+
<div><span class="ant-tag ant-tag-pink">pink</span> <span class="ant-tag ant-tag-red">red</span> <span class="ant-tag ant-tag-orange">orange</span> <span class="ant-tag ant-tag-green">green</span> <span class="ant-tag ant-tag-cyan">cyan</span> <span class="ant-tag ant-tag-blue">blue</span> <span class="ant-tag ant-tag-purple">purple</span></div>
3617
<h4>Custom:</h4>
37-
<div>
38-
<div class="ant-tag ant-tag-has-color" style="background-color: rgb(255, 85, 0);">#f50</div>
39-
<div class="ant-tag ant-tag-has-color" style="background-color: rgb(45, 183, 245);">#2db7f5</div>
40-
<div class="ant-tag ant-tag-has-color" style="background-color: rgb(135, 208, 104);">#87d068</div>
41-
<div class="ant-tag ant-tag-has-color" style="background-color: rgb(16, 142, 233);">#108ee9</div>
42-
</div>
18+
<div><span class="ant-tag ant-tag-has-color" style="background-color: rgb(255, 85, 0);">#f50</span> <span class="ant-tag ant-tag-has-color" style="background-color: rgb(45, 183, 245);">#2db7f5</span> <span class="ant-tag ant-tag-has-color" style="background-color: rgb(135, 208, 104);">#87d068</span> <span class="ant-tag ant-tag-has-color" style="background-color: rgb(16, 142, 233);">#108ee9</span></div>
4319
</div>
4420
`;
4521

4622
exports[`renders ./components/tag/demo/control.md correctly 1`] = `
47-
<div>
48-
<div class="ant-tag">
49-
Unremovable
50-
</div>
51-
<div class="ant-tag">
52-
Tag 2
53-
<i aria-label="icon: close" tabindex="-1" class="anticon anticon-close"><svg viewBox="64 64 896 896" data-icon="close" width="1em" height="1em" fill="currentColor" aria-hidden="true" focusable="false" class="">
54-
<path d="M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 0 0 203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"></path>
55-
</svg></i></div>
56-
<div class="ant-tag">
57-
Tag 3Tag 3Tag 3Tag 3...
58-
<i aria-label="icon: close" tabindex="-1" class="anticon anticon-close"><svg viewBox="64 64 896 896" data-icon="close" width="1em" height="1em" fill="currentColor" aria-hidden="true" focusable="false" class="">
59-
<path d="M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 0 0 203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"></path>
60-
</svg></i></div>
61-
<div class="ant-tag" style="border-style: dashed; background: rgb(255, 255, 255);"><i aria-label="icon: plus" class="anticon anticon-plus"><svg viewBox="64 64 896 896" data-icon="plus" width="1em" height="1em" fill="currentColor" aria-hidden="true" focusable="false" class="">
62-
<path d="M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z"></path>
63-
<path d="M176 474h672q8 0 8 8v60q0 8-8 8H176q-8 0-8-8v-60q0-8 8-8z"></path>
64-
</svg></i> New Tag
65-
</div>
66-
</div>
23+
<div><span class="ant-tag">
24+
Unremovable
25+
</span><span class="ant-tag">
26+
Tag 2
27+
<i aria-label="icon: close" tabindex="-1" class="anticon anticon-close"><svg viewBox="64 64 896 896" data-icon="close" width="1em" height="1em" fill="currentColor" aria-hidden="true" focusable="false" class=""><path d="M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 0 0 203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"></path></svg></i></span><span class="ant-tag">
28+
Tag 3Tag 3Tag 3Tag 3...
29+
<i aria-label="icon: close" tabindex="-1" class="anticon anticon-close"><svg viewBox="64 64 896 896" data-icon="close" width="1em" height="1em" fill="currentColor" aria-hidden="true" focusable="false" class=""><path d="M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 0 0 203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"></path></svg></i></span> <span class="ant-tag" style="border-style: dashed; background: rgb(255, 255, 255);"><i aria-label="icon: plus" class="anticon anticon-plus"><svg viewBox="64 64 896 896" data-icon="plus" width="1em" height="1em" fill="currentColor" aria-hidden="true" focusable="false" class=""><path d="M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z"></path><path d="M176 474h672q8 0 8 8v60q0 8-8 8H176q-8 0-8-8v-60q0-8 8-8z"></path></svg></i> New Tag
30+
</span></div>
6731
`;
6832

6933
exports[`renders ./components/tag/demo/controlled.md correctly 1`] = `
70-
<div>
71-
<div class="ant-tag">
34+
<div><span class="ant-tag">
7235
Movies
73-
<i aria-label="icon: close" tabindex="-1" class="anticon anticon-close"><svg viewBox="64 64 896 896" data-icon="close" width="1em" height="1em" fill="currentColor" aria-hidden="true" focusable="false" class="">
74-
<path d="M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 0 0 203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"></path>
75-
</svg></i></div> <br> <button type="button" class="ant-btn ant-btn-sm"><span>Toggle</span></button>
76-
</div>
36+
<i aria-label="icon: close" tabindex="-1" class="anticon anticon-close"><svg viewBox="64 64 896 896" data-icon="close" width="1em" height="1em" fill="currentColor" aria-hidden="true" focusable="false" class=""><path d="M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 0 0 203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"></path></svg></i></span> <br> <button type="button" class="ant-btn ant-btn-sm"><span>Toggle</span></button></div>
7737
`;
7838
7939
exports[`renders ./components/tag/demo/hot-tags.md correctly 1`] = `
80-
<div><strong>Categories:</strong>
40+
<div><span>Categories:</span>
8141
<div class="ant-tag ant-tag-checkable">
8242
Movies
8343
</div>
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

3-
exports[`Tag visibility can be controlled by visible with hidden as initial value 1`] = `<div class="ant-tag" style="display: none;"></div>`;
3+
exports[`Tag visibility can be controlled by visible with hidden as initial value 1`] = `<span class="ant-tag" style="display: none;"></span>`;
44

5-
exports[`Tag visibility can be controlled by visible with hidden as initial value 2`] = `<div class="ant-tag" style=""></div>`;
5+
exports[`Tag visibility can be controlled by visible with hidden as initial value 2`] = `<span class="ant-tag" style=""></span>`;
66

7-
exports[`Tag visibility can be controlled by visible with hidden as initial value 3`] = `<div class="ant-tag" style="display: none;"></div>`;
7+
exports[`Tag visibility can be controlled by visible with hidden as initial value 3`] = `<span class="ant-tag" style="display: none;"></span>`;
88

9-
exports[`Tag visibility can be controlled by visible with visible as initial value 1`] = `<div class="ant-tag"></div>`;
9+
exports[`Tag visibility can be controlled by visible with visible as initial value 1`] = `<span class="ant-tag"></span>`;
1010

11-
exports[`Tag visibility can be controlled by visible with visible as initial value 2`] = `<div class="ant-tag" style="display: none;"></div>`;
11+
exports[`Tag visibility can be controlled by visible with visible as initial value 2`] = `<span class="ant-tag" style="display: none;"></span>`;
1212

13-
exports[`Tag visibility can be controlled by visible with visible as initial value 3`] = `<div class="ant-tag" style=""></div>`;
13+
exports[`Tag visibility can be controlled by visible with visible as initial value 3`] = `<span class="ant-tag" style=""></span>`;

components/tag/__tests__/index.test.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
import { mount } from '@vue/test-utils';
22
import { asyncExpect } from '@/tests/utils';
33
import Tag from '..';
4+
import mountTest from '../../../tests/shared/mountTest';
45

56
describe('Tag', () => {
7+
mountTest(Tag);
8+
mountTest(Tag.CheckableTag);
69
it('should be closable', async () => {
710
const onClose = jest.fn();
811
const wrapper = mount(

components/tag/demo/basic.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<cn>
22
#### 基本用法
3-
基本标签的用法,可以通过添加 `closable` 变为可关闭标签。可关闭标签具有 `onClose` `afterClose` 两个事件。
3+
基本标签的用法,可以通过添加 `closable` 变为可关闭标签。可关闭标签具有 `close` 两个事件。
44
</cn>
55

66
<us>
77
#### basic Usage
8-
Usage of basic Tag, and it could be closable by set `closable` property. Closable Tag supports `onClose` `afterClose` events.
8+
Usage of basic Tag, and it could be closable by set `closable` property. Closable Tag supports `close` events.
99
</us>
1010

1111
```tpl
@@ -15,7 +15,7 @@ Usage of basic Tag, and it could be closable by set `closable` property. Closabl
1515
<a-tag><a href="https://github.com/vueComponent/ant-design">Link</a></a-tag>
1616
<a-tag closable @close="log">Tag 2</a-tag>
1717
<a-tag closable @close="preventDefault">Prevent Default</a-tag>
18-
</div>
18+
</div>
1919
</template>
2020
<script>
2121
export default {

components/tag/demo/colorful.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55

66
<us>
77
#### Colorful Tag
8-
We preset a series of colorful tag style for different situation usage.
9-
And you can always set it to a hex color string for custom color.
8+
We preset a series of colorful tag styles for use in different situations. You can also set it to a hex color string for custom color.
109
</us>
1110

1211
```tpl

components/tag/demo/control.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
11
<cn>
22
#### 动态添加和删除
3-
用数组生成一组标签,可以动态添加和删除,通过监听删除动画结束的事件 `afterClose` 实现
3+
用数组生成一组标签,可以动态添加和删除。
44
</cn>
55

66
<us>
77
#### Add & Remove Dynamically
88
Generating a set of Tags by array, you can add and remove dynamically.
9-
It's based on `afterClose` event, which will be triggered while the close animation end.
109
</us>
1110

1211
```tpl
1312
<template>
1413
<div>
1514
<template v-for="(tag, index) in tags">
1615
<a-tooltip v-if="tag.length > 20" :key="tag" :title="tag">
17-
<a-tag :key="tag" :closable="index !== 0" :afterClose="() => handleClose(tag)">
16+
<a-tag :key="tag" :closable="index !== 0" @close="() => handleClose(tag)">
1817
{{`${tag.slice(0, 20)}...`}}
1918
</a-tag>
2019
</a-tooltip>
21-
<a-tag v-else :key="tag" :closable="index !== 0" :afterClose="() => handleClose(tag)">
20+
<a-tag v-else :key="tag" :closable="index !== 0" @close="() => handleClose(tag)">
2221
{{tag}}
2322
</a-tag>
2423
</template>

components/tag/demo/controlled.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ By using the `visible` prop, you can control the close state of Tag.
1515
Movies
1616
</a-tag>
1717
<br />
18-
<a-button size="small" @click="()=>{this.visible = !this.visible}">
18+
<a-button size="small" @click="visible = !visible">
1919
Toggle
2020
</a-button>
2121
</div>

components/tag/demo/hot-tags.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Select your favourite topics.
1111
```tpl
1212
<template>
1313
<div>
14-
<strong :style="{ marginRight: 8 }">Categories:</strong>
14+
<span :style="{ marginRight: 8 }">Categories:</span>
1515
<template v-for=" tag in tags">
1616
<a-checkable-tag
1717
:key="tag"

0 commit comments

Comments
 (0)