fix: 修改权限按钮重复点击问题
This commit is contained in:
parent
bf6c705eda
commit
24690e1cdb
|
@ -4,14 +4,14 @@
|
||||||
<a-popconfirm v-bind="popConfirm" @confirm="conform" :disabled="!isPermission || props.disabled">
|
<a-popconfirm v-bind="popConfirm" @confirm="conform" :disabled="!isPermission || props.disabled">
|
||||||
<a-tooltip v-if="tooltip" v-bind="tooltip">
|
<a-tooltip v-if="tooltip" v-bind="tooltip">
|
||||||
<slot v-if="noButton"></slot>
|
<slot v-if="noButton"></slot>
|
||||||
<a-button v-else v-bind="_buttonProps" :disabled="_isPermission" @click="handleClick">
|
<a-button v-else v-bind="_buttonProps" :disabled="_isPermission" >
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<slot name="icon"></slot>
|
<slot name="icon"></slot>
|
||||||
</template>
|
</template>
|
||||||
</a-button>
|
</a-button>
|
||||||
</a-tooltip>
|
</a-tooltip>
|
||||||
<a-button v-else v-bind="_buttonProps" :disabled="_isPermission" @click="handleClick">
|
<a-button v-else v-bind="_buttonProps" :disabled="_isPermission" >
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<slot name="icon"></slot>
|
<slot name="icon"></slot>
|
||||||
|
@ -22,7 +22,7 @@
|
||||||
<template v-else-if="tooltip">
|
<template v-else-if="tooltip">
|
||||||
<a-tooltip v-bind="tooltip">
|
<a-tooltip v-bind="tooltip">
|
||||||
<slot v-if="noButton"></slot>
|
<slot v-if="noButton"></slot>
|
||||||
<a-button v-else v-bind="_buttonProps" :disabled="_isPermission" @click="handleClick">
|
<a-button v-else v-bind="_buttonProps" :disabled="_isPermission" >
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<slot name="icon"></slot>
|
<slot name="icon"></slot>
|
||||||
|
@ -32,7 +32,7 @@
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<slot v-if="noButton"></slot>
|
<slot v-if="noButton"></slot>
|
||||||
<a-button v-else v-bind="_buttonProps" :disabled="_isPermission" @click="handleClick">
|
<a-button v-else v-bind="_buttonProps" :disabled="_isPermission" >
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<slot name="icon"></slot>
|
<slot name="icon"></slot>
|
||||||
|
@ -42,7 +42,7 @@
|
||||||
</template>
|
</template>
|
||||||
<a-tooltip v-else title="没有权限">
|
<a-tooltip v-else title="没有权限">
|
||||||
<slot v-if="noButton"></slot>
|
<slot v-if="noButton"></slot>
|
||||||
<a-button v-else v-bind="_buttonProps" :disabled="_isPermission" @click="handleClick">
|
<a-button v-else v-bind="_buttonProps" :disabled="_isPermission" >
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<slot name="icon"></slot>
|
<slot name="icon"></slot>
|
||||||
|
@ -56,11 +56,11 @@ import { TooltipProps, PopconfirmProps } from 'ant-design-vue/es'
|
||||||
import { buttonProps } from 'ant-design-vue/es/button/button'
|
import { buttonProps } from 'ant-design-vue/es/button/button'
|
||||||
import { usePermissionStore } from '@/store/permission';
|
import { usePermissionStore } from '@/store/permission';
|
||||||
|
|
||||||
interface PermissionButtonEmits {
|
// interface PermissionButtonEmits {
|
||||||
(e: 'click', data: MouseEvent): void;
|
// (e: 'click', data: MouseEvent): void;
|
||||||
}
|
// }
|
||||||
|
|
||||||
const emits = defineEmits<PermissionButtonEmits>()
|
// const emits = defineEmits<PermissionButtonEmits>()
|
||||||
|
|
||||||
// interface PermissionButtonProps extends ButtonProps {
|
// interface PermissionButtonProps extends ButtonProps {
|
||||||
// tooltip?: TooltipProps;
|
// tooltip?: TooltipProps;
|
||||||
|
@ -105,9 +105,6 @@ const _isPermission = computed(() =>
|
||||||
: false
|
: false
|
||||||
: true
|
: true
|
||||||
)
|
)
|
||||||
const handleClick = (e: MouseEvent) => {
|
|
||||||
emits('click', e)
|
|
||||||
}
|
|
||||||
|
|
||||||
const conform = (e: MouseEvent) => {
|
const conform = (e: MouseEvent) => {
|
||||||
props.popConfirm?.onConfirm?.(e)
|
props.popConfirm?.onConfirm?.(e)
|
||||||
|
|
Loading…
Reference in New Issue