fix: tag
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,29 +43,8 @@ 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(() => {
|
|
||||||
if ('visible' in props) {
|
|
||||||
visible.value = props.visible!;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const handleCloseClick = (e: MouseEvent) => {
|
|
||||||
e.stopPropagation();
|
|
||||||
if (props.onClose) {
|
|
||||||
props.onClose(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (e.defaultPrevented) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!('visible' in props)) {
|
|
||||||
visible.value = false;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
const {
|
const {
|
||||||
prefixCls: customizePrefixCls,
|
prefixCls: customizePrefixCls,
|
||||||
|
@ -79,6 +57,24 @@ const Tag = defineComponent({
|
||||||
...restProps
|
...restProps
|
||||||
} = props;
|
} = props;
|
||||||
|
|
||||||
|
if ('visible' in props) {
|
||||||
|
visible.value = props.visible!;
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleCloseClick = (e: MouseEvent) => {
|
||||||
|
e.stopPropagation();
|
||||||
|
if (props.onClose) {
|
||||||
|
props.onClose(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (e.defaultPrevented) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!('visible' in props)) {
|
||||||
|
visible.value = false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const isPresetColor = (): boolean => {
|
const isPresetColor = (): boolean => {
|
||||||
if (!color) {
|
if (!color) {
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue