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