pull/2933/head
Amour1688 4 years ago
parent dffb0cce52
commit b19ca0aaaf

@ -5,7 +5,6 @@ import {
defineComponent, defineComponent,
SetupContext, SetupContext,
App, App,
watchEffect,
VNodeTypes, VNodeTypes,
CSSProperties, CSSProperties,
} from 'vue'; } from 'vue';
@ -44,14 +43,23 @@ const Tag = defineComponent({
const { getPrefixCls } = inject('configProvider', defaultConfigProvider); const { getPrefixCls } = inject('configProvider', defaultConfigProvider);
const visible = ref(true); const visible = ref(true);
const props = attrs as TagProps; const props = attrs as TagProps;
watchEffect(() => { return () => {
const {
prefixCls: customizePrefixCls,
icon,
color,
closeIcon,
class: className,
style = {},
closable = false,
...restProps
} = props;
if ('visible' in props) { if ('visible' in props) {
visible.value = props.visible!; visible.value = props.visible!;
} }
});
const handleCloseClick = (e: MouseEvent) => { const handleCloseClick = (e: MouseEvent) => {
e.stopPropagation(); e.stopPropagation();
@ -67,18 +75,6 @@ const Tag = defineComponent({
} }
}; };
return () => {
const {
prefixCls: customizePrefixCls,
icon,
color,
closeIcon,
class: className,
style = {},
closable = false,
...restProps
} = props;
const isPresetColor = (): boolean => { const isPresetColor = (): boolean => {
if (!color) { if (!color) {
return false; return false;

Loading…
Cancel
Save