@meethive/components 0.0.11 → 0.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/es/Ellipsis/Ellipsis.js
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import { defineComponent
|
|
1
|
+
import { defineComponent as _defineComponent } from 'vue';
|
|
2
|
+
import { renderSlot as _renderSlot, mergeProps as _mergeProps, createElementVNode as _createElementVNode, unref as _unref, normalizeClass as _normalizeClass, withCtx as _withCtx, createSlots as _createSlots, openBlock as _openBlock, createBlock as _createBlock } from "vue";
|
|
3
|
+
import { computed, ref, useAttrs, mergeProps } from 'vue';
|
|
2
4
|
import { Tooltip } from 'ant-design-vue';
|
|
3
5
|
import useEllipsisStyle from './style';
|
|
4
6
|
const jEllipsis = 'j-ellipsis';
|
|
5
7
|
const jEllipsisCursorClass = 'j-ellipsis-cursor';
|
|
6
8
|
const jEllipsisLineClampClass = 'j-ellipsis-line-clamp';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
Tooltip
|
|
9
|
+
const __sfc_main__ = _defineComponent({
|
|
10
|
+
...{
|
|
11
|
+
name: 'JEllipsis'
|
|
11
12
|
},
|
|
13
|
+
__name: 'Ellipsis',
|
|
12
14
|
props: {
|
|
13
15
|
expandTrigger: {
|
|
14
16
|
type: String,
|
|
@@ -24,7 +26,8 @@ export default defineComponent({
|
|
|
24
26
|
default: true
|
|
25
27
|
}
|
|
26
28
|
},
|
|
27
|
-
setup(
|
|
29
|
+
setup(__props) {
|
|
30
|
+
const props = __props;
|
|
28
31
|
const prefixCls = computed(() => 'j-ellipsis');
|
|
29
32
|
const [wrapSSR, hashId] = useEllipsisStyle(prefixCls);
|
|
30
33
|
|
|
@@ -127,18 +130,31 @@ export default defineComponent({
|
|
|
127
130
|
}
|
|
128
131
|
return tooltipDisabled;
|
|
129
132
|
};
|
|
130
|
-
return {
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
133
|
+
return (_ctx, _cache) => {
|
|
134
|
+
return _openBlock(), _createBlock(_unref(Tooltip), _mergeProps({
|
|
135
|
+
ref_key: "tooltipRef",
|
|
136
|
+
ref: tooltipRef,
|
|
137
|
+
placement: "top"
|
|
138
|
+
}, __props.tooltip, {
|
|
139
|
+
open: visible.value && __props.tooltip !== false
|
|
140
|
+
}), _createSlots({
|
|
141
|
+
default: _withCtx(() => [_createElementVNode("span", _mergeProps({
|
|
142
|
+
ref_key: "triggerRef",
|
|
143
|
+
ref: triggerRef
|
|
144
|
+
}, triggerAttrs(), {
|
|
145
|
+
onClick: _cache[0] || (_cache[0] = $event => handleClickRef.value && handleClickRef.value()),
|
|
146
|
+
onMouseleave: _cache[1] || (_cache[1] = $event => visible.value = false),
|
|
147
|
+
onMouseenter: _cache[2] || (_cache[2] = $event => __props.expandTrigger === 'click' ? getTooltipDisabled() : showTooltip())
|
|
148
|
+
}), [_renderSlot(_ctx.$slots, "default")], 16 /* FULL_PROPS */)]),
|
|
149
|
+
_: 2 /* DYNAMIC */
|
|
150
|
+
}, [__props.tooltip ? {
|
|
151
|
+
name: "title",
|
|
152
|
+
fn: _withCtx(() => [_createElementVNode("div", {
|
|
153
|
+
class: _normalizeClass([jEllipsisLineClampClass, jEllipsis, 'j-ellipsis-deep', _unref(hashId)])
|
|
154
|
+
}, [_renderSlot(_ctx.$slots, "default"), _renderSlot(_ctx.$slots, "tooltip")], 2 /* CLASS */)]),
|
|
155
|
+
key: "0"
|
|
156
|
+
} : undefined]), 1040 /* FULL_PROPS, DYNAMIC_SLOTS */, ["open"]);
|
|
142
157
|
};
|
|
143
158
|
}
|
|
144
|
-
});
|
|
159
|
+
});
|
|
160
|
+
export default __sfc_main__;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { defineComponent
|
|
1
|
+
import { defineComponent as _defineComponent } from 'vue';
|
|
2
|
+
import { createCommentVNode as _createCommentVNode, renderSlot as _renderSlot, unref as _unref, mergeProps as _mergeProps, withCtx as _withCtx, createSlots as _createSlots, openBlock as _openBlock, createBlock as _createBlock, normalizeProps as _normalizeProps, Fragment as _Fragment, createElementBlock as _createElementBlock, createVNode as _createVNode } from "vue";
|
|
3
|
+
import { computed, inject, toRefs } from 'vue';
|
|
2
4
|
import { Button, Tooltip, Modal } from 'ant-design-vue';
|
|
3
5
|
import { omit } from 'lodash-es';
|
|
4
6
|
import { buttonProps } from 'ant-design-vue/es/button/button';
|
|
@@ -6,39 +8,35 @@ import { usePermission } from '@meethive/hooks';
|
|
|
6
8
|
import confirm from './confirm';
|
|
7
9
|
import { PermissionButtonConfig } from '../utils/constants';
|
|
8
10
|
import { useLocaleReceiver } from '../LocaleReciver';
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
const __sfc_main__ = _defineComponent({
|
|
12
|
+
...{
|
|
13
|
+
name: 'JPermissionButton'
|
|
12
14
|
},
|
|
13
|
-
|
|
14
|
-
|
|
15
|
+
__name: 'PermissionButton',
|
|
16
|
+
props: {
|
|
17
|
+
tooltip: {
|
|
18
|
+
type: Object
|
|
19
|
+
},
|
|
20
|
+
popConfirm: {
|
|
21
|
+
type: Object
|
|
22
|
+
},
|
|
23
|
+
hasPermission: {
|
|
24
|
+
type: [String, Array, Boolean],
|
|
25
|
+
default: undefined
|
|
26
|
+
},
|
|
27
|
+
style: {
|
|
28
|
+
type: Object
|
|
29
|
+
},
|
|
30
|
+
noPermissionTitle: {
|
|
31
|
+
type: String
|
|
32
|
+
},
|
|
33
|
+
popConfirmBefore: {
|
|
34
|
+
type: Function
|
|
35
|
+
},
|
|
36
|
+
...omit(buttonProps(), 'icon')
|
|
15
37
|
},
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
default: undefined
|
|
19
|
-
},
|
|
20
|
-
style: {
|
|
21
|
-
type: Object
|
|
22
|
-
},
|
|
23
|
-
noPermissionTitle: {
|
|
24
|
-
type: String
|
|
25
|
-
},
|
|
26
|
-
popConfirmBefore: {
|
|
27
|
-
type: Function
|
|
28
|
-
},
|
|
29
|
-
...omit(buttonProps(), 'icon')
|
|
30
|
-
};
|
|
31
|
-
export default defineComponent({
|
|
32
|
-
name: 'JPermissionButton',
|
|
33
|
-
components: {
|
|
34
|
-
Button,
|
|
35
|
-
Tooltip
|
|
36
|
-
},
|
|
37
|
-
// @ts-ignore
|
|
38
|
-
slots: ['button', 'icon'],
|
|
39
|
-
props: definedProps,
|
|
40
|
-
setup(props) {
|
|
41
|
-
const instance = getCurrentInstance();
|
|
38
|
+
setup(__props) {
|
|
39
|
+
const props = __props;
|
|
42
40
|
const propsRef = toRefs(props);
|
|
43
41
|
const {
|
|
44
42
|
hasPerm
|
|
@@ -61,6 +59,28 @@ export default defineComponent({
|
|
|
61
59
|
});
|
|
62
60
|
const hasTooltip = computed(() => !!props.tooltip); // 是否包含文字提示
|
|
63
61
|
|
|
62
|
+
// popConfirm 点击处理
|
|
63
|
+
const handleClick = async () => {
|
|
64
|
+
const _popConfirm = (await props.popConfirmBefore?.()) || props.popConfirm;
|
|
65
|
+
if (context.components) {
|
|
66
|
+
confirm({
|
|
67
|
+
..._popConfirm,
|
|
68
|
+
danger: props.danger
|
|
69
|
+
}, context.components);
|
|
70
|
+
} else {
|
|
71
|
+
Modal.confirm({
|
|
72
|
+
title: _popConfirm.title,
|
|
73
|
+
content: _popConfirm.content,
|
|
74
|
+
onOk: () => {
|
|
75
|
+
return _popConfirm.onConfirm?.();
|
|
76
|
+
},
|
|
77
|
+
onCancel: () => {
|
|
78
|
+
_popConfirm.onCancel?.();
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
|
|
64
84
|
// 排除不传递给 Button 的属性 (与 ES 原版 _excluded 一致)
|
|
65
85
|
const computedButtonProps = computed(() => {
|
|
66
86
|
const {
|
|
@@ -83,36 +103,64 @@ export default defineComponent({
|
|
|
83
103
|
disabled: isPermission.value
|
|
84
104
|
});
|
|
85
105
|
});
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
},
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
})
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
106
|
+
return (_ctx, _cache) => {
|
|
107
|
+
return _openBlock(), _createElementBlock(_Fragment, null, [_createCommentVNode(" 有权限 "), permission.value ? (_openBlock(), _createElementBlock(_Fragment, {
|
|
108
|
+
key: 0
|
|
109
|
+
}, [_createCommentVNode(" 有 tooltip "), hasTooltip.value ? (_openBlock(), _createBlock(_unref(Tooltip), _normalizeProps(_mergeProps({
|
|
110
|
+
key: 0
|
|
111
|
+
}, tooltipProps.value)), {
|
|
112
|
+
default: _withCtx(() => [_ctx.$slots.button ? _renderSlot(_ctx.$slots, "button", {
|
|
113
|
+
key: 0
|
|
114
|
+
}) : (_openBlock(), _createBlock(_unref(Button), _mergeProps({
|
|
115
|
+
key: 1
|
|
116
|
+
}, computedButtonProps.value, {
|
|
117
|
+
disabled: isPermission.value
|
|
118
|
+
}), _createSlots({
|
|
119
|
+
default: _withCtx(() => [_renderSlot(_ctx.$slots, "default")]),
|
|
120
|
+
_: 2 /* DYNAMIC */
|
|
121
|
+
}, [_ctx.$slots.icon ? {
|
|
122
|
+
name: "icon",
|
|
123
|
+
fn: _withCtx(() => [_renderSlot(_ctx.$slots, "icon")]),
|
|
124
|
+
key: "0"
|
|
125
|
+
} : undefined]), 1040 /* FULL_PROPS, DYNAMIC_SLOTS */, ["disabled"]))]),
|
|
126
|
+
_: 3 /* FORWARDED */
|
|
127
|
+
}, 16 /* FULL_PROPS */)) : (_openBlock(), _createElementBlock(_Fragment, {
|
|
128
|
+
key: 1
|
|
129
|
+
}, [_createCommentVNode(" 无 tooltip "), _ctx.$slots.button ? _renderSlot(_ctx.$slots, "button", {
|
|
130
|
+
key: 0
|
|
131
|
+
}) : (_openBlock(), _createBlock(_unref(Button), _mergeProps({
|
|
132
|
+
key: 1
|
|
133
|
+
}, computedButtonProps.value, {
|
|
134
|
+
disabled: isPermission.value
|
|
135
|
+
}), _createSlots({
|
|
136
|
+
default: _withCtx(() => [_renderSlot(_ctx.$slots, "default")]),
|
|
137
|
+
_: 2 /* DYNAMIC */
|
|
138
|
+
}, [_ctx.$slots.icon ? {
|
|
139
|
+
name: "icon",
|
|
140
|
+
fn: _withCtx(() => [_renderSlot(_ctx.$slots, "icon")]),
|
|
141
|
+
key: "0"
|
|
142
|
+
} : undefined]), 1040 /* FULL_PROPS, DYNAMIC_SLOTS */, ["disabled"]))], 64 /* STABLE_FRAGMENT */))], 64 /* STABLE_FRAGMENT */)) : (_openBlock(), _createElementBlock(_Fragment, {
|
|
143
|
+
key: 1
|
|
144
|
+
}, [_createCommentVNode(" 无权限 "), _createVNode(_unref(Tooltip), {
|
|
145
|
+
title: _ctx.noPermissionTitle || _unref(contextLocale)?.hasPermission
|
|
146
|
+
}, {
|
|
147
|
+
default: _withCtx(() => [_ctx.$slots.button ? _renderSlot(_ctx.$slots, "button", {
|
|
148
|
+
key: 0
|
|
149
|
+
}) : (_openBlock(), _createBlock(_unref(Button), _mergeProps({
|
|
150
|
+
key: 1
|
|
151
|
+
}, computedButtonProps.value, {
|
|
152
|
+
disabled: isPermission.value
|
|
153
|
+
}), _createSlots({
|
|
154
|
+
default: _withCtx(() => [_renderSlot(_ctx.$slots, "default")]),
|
|
155
|
+
_: 2 /* DYNAMIC */
|
|
156
|
+
}, [_ctx.$slots.icon ? {
|
|
157
|
+
name: "icon",
|
|
158
|
+
fn: _withCtx(() => [_renderSlot(_ctx.$slots, "icon")]),
|
|
159
|
+
key: "0"
|
|
160
|
+
} : undefined]), 1040 /* FULL_PROPS, DYNAMIC_SLOTS */, ["disabled"]))]),
|
|
161
|
+
_: 3 /* FORWARDED */
|
|
162
|
+
}, 8 /* PROPS */, ["title"])], 2112 /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */))], 2112 /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */);
|
|
116
163
|
};
|
|
117
164
|
}
|
|
118
|
-
});
|
|
165
|
+
});
|
|
166
|
+
export default __sfc_main__;
|
package/lib/Ellipsis/Ellipsis.js
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import { defineComponent
|
|
1
|
+
import { defineComponent as _defineComponent } from 'vue';
|
|
2
|
+
import { renderSlot as _renderSlot, mergeProps as _mergeProps, createElementVNode as _createElementVNode, unref as _unref, normalizeClass as _normalizeClass, withCtx as _withCtx, createSlots as _createSlots, openBlock as _openBlock, createBlock as _createBlock } from "vue";
|
|
3
|
+
import { computed, ref, useAttrs, mergeProps } from 'vue';
|
|
2
4
|
import { Tooltip } from 'ant-design-vue';
|
|
3
5
|
import useEllipsisStyle from './style';
|
|
4
6
|
const jEllipsis = 'j-ellipsis';
|
|
5
7
|
const jEllipsisCursorClass = 'j-ellipsis-cursor';
|
|
6
8
|
const jEllipsisLineClampClass = 'j-ellipsis-line-clamp';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
Tooltip
|
|
9
|
+
const __sfc_main__ = _defineComponent({
|
|
10
|
+
...{
|
|
11
|
+
name: 'JEllipsis'
|
|
11
12
|
},
|
|
13
|
+
__name: 'Ellipsis',
|
|
12
14
|
props: {
|
|
13
15
|
expandTrigger: {
|
|
14
16
|
type: String,
|
|
@@ -24,7 +26,8 @@ export default defineComponent({
|
|
|
24
26
|
default: true
|
|
25
27
|
}
|
|
26
28
|
},
|
|
27
|
-
setup(
|
|
29
|
+
setup(__props) {
|
|
30
|
+
const props = __props;
|
|
28
31
|
const prefixCls = computed(() => 'j-ellipsis');
|
|
29
32
|
const [wrapSSR, hashId] = useEllipsisStyle(prefixCls);
|
|
30
33
|
|
|
@@ -127,18 +130,31 @@ export default defineComponent({
|
|
|
127
130
|
}
|
|
128
131
|
return tooltipDisabled;
|
|
129
132
|
};
|
|
130
|
-
return {
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
133
|
+
return (_ctx, _cache) => {
|
|
134
|
+
return _openBlock(), _createBlock(_unref(Tooltip), _mergeProps({
|
|
135
|
+
ref_key: "tooltipRef",
|
|
136
|
+
ref: tooltipRef,
|
|
137
|
+
placement: "top"
|
|
138
|
+
}, __props.tooltip, {
|
|
139
|
+
open: visible.value && __props.tooltip !== false
|
|
140
|
+
}), _createSlots({
|
|
141
|
+
default: _withCtx(() => [_createElementVNode("span", _mergeProps({
|
|
142
|
+
ref_key: "triggerRef",
|
|
143
|
+
ref: triggerRef
|
|
144
|
+
}, triggerAttrs(), {
|
|
145
|
+
onClick: _cache[0] || (_cache[0] = $event => handleClickRef.value && handleClickRef.value()),
|
|
146
|
+
onMouseleave: _cache[1] || (_cache[1] = $event => visible.value = false),
|
|
147
|
+
onMouseenter: _cache[2] || (_cache[2] = $event => __props.expandTrigger === 'click' ? getTooltipDisabled() : showTooltip())
|
|
148
|
+
}), [_renderSlot(_ctx.$slots, "default")], 16 /* FULL_PROPS */)]),
|
|
149
|
+
_: 2 /* DYNAMIC */
|
|
150
|
+
}, [__props.tooltip ? {
|
|
151
|
+
name: "title",
|
|
152
|
+
fn: _withCtx(() => [_createElementVNode("div", {
|
|
153
|
+
class: _normalizeClass([jEllipsisLineClampClass, jEllipsis, 'j-ellipsis-deep', _unref(hashId)])
|
|
154
|
+
}, [_renderSlot(_ctx.$slots, "default"), _renderSlot(_ctx.$slots, "tooltip")], 2 /* CLASS */)]),
|
|
155
|
+
key: "0"
|
|
156
|
+
} : undefined]), 1040 /* FULL_PROPS, DYNAMIC_SLOTS */, ["open"]);
|
|
142
157
|
};
|
|
143
158
|
}
|
|
144
|
-
});
|
|
159
|
+
});
|
|
160
|
+
export default __sfc_main__;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { defineComponent
|
|
1
|
+
import { defineComponent as _defineComponent } from 'vue';
|
|
2
|
+
import { createCommentVNode as _createCommentVNode, renderSlot as _renderSlot, unref as _unref, mergeProps as _mergeProps, withCtx as _withCtx, createSlots as _createSlots, openBlock as _openBlock, createBlock as _createBlock, normalizeProps as _normalizeProps, Fragment as _Fragment, createElementBlock as _createElementBlock, createVNode as _createVNode } from "vue";
|
|
3
|
+
import { computed, inject, toRefs } from 'vue';
|
|
2
4
|
import { Button, Tooltip, Modal } from 'ant-design-vue';
|
|
3
5
|
import { omit } from 'lodash-es';
|
|
4
6
|
import { buttonProps } from 'ant-design-vue/es/button/button';
|
|
@@ -6,39 +8,35 @@ import { usePermission } from '@meethive/hooks';
|
|
|
6
8
|
import confirm from './confirm';
|
|
7
9
|
import { PermissionButtonConfig } from '../utils/constants';
|
|
8
10
|
import { useLocaleReceiver } from '../LocaleReciver';
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
const __sfc_main__ = _defineComponent({
|
|
12
|
+
...{
|
|
13
|
+
name: 'JPermissionButton'
|
|
12
14
|
},
|
|
13
|
-
|
|
14
|
-
|
|
15
|
+
__name: 'PermissionButton',
|
|
16
|
+
props: {
|
|
17
|
+
tooltip: {
|
|
18
|
+
type: Object
|
|
19
|
+
},
|
|
20
|
+
popConfirm: {
|
|
21
|
+
type: Object
|
|
22
|
+
},
|
|
23
|
+
hasPermission: {
|
|
24
|
+
type: [String, Array, Boolean],
|
|
25
|
+
default: undefined
|
|
26
|
+
},
|
|
27
|
+
style: {
|
|
28
|
+
type: Object
|
|
29
|
+
},
|
|
30
|
+
noPermissionTitle: {
|
|
31
|
+
type: String
|
|
32
|
+
},
|
|
33
|
+
popConfirmBefore: {
|
|
34
|
+
type: Function
|
|
35
|
+
},
|
|
36
|
+
...omit(buttonProps(), 'icon')
|
|
15
37
|
},
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
default: undefined
|
|
19
|
-
},
|
|
20
|
-
style: {
|
|
21
|
-
type: Object
|
|
22
|
-
},
|
|
23
|
-
noPermissionTitle: {
|
|
24
|
-
type: String
|
|
25
|
-
},
|
|
26
|
-
popConfirmBefore: {
|
|
27
|
-
type: Function
|
|
28
|
-
},
|
|
29
|
-
...omit(buttonProps(), 'icon')
|
|
30
|
-
};
|
|
31
|
-
export default defineComponent({
|
|
32
|
-
name: 'JPermissionButton',
|
|
33
|
-
components: {
|
|
34
|
-
Button,
|
|
35
|
-
Tooltip
|
|
36
|
-
},
|
|
37
|
-
// @ts-ignore
|
|
38
|
-
slots: ['button', 'icon'],
|
|
39
|
-
props: definedProps,
|
|
40
|
-
setup(props) {
|
|
41
|
-
const instance = getCurrentInstance();
|
|
38
|
+
setup(__props) {
|
|
39
|
+
const props = __props;
|
|
42
40
|
const propsRef = toRefs(props);
|
|
43
41
|
const {
|
|
44
42
|
hasPerm
|
|
@@ -61,6 +59,28 @@ export default defineComponent({
|
|
|
61
59
|
});
|
|
62
60
|
const hasTooltip = computed(() => !!props.tooltip); // 是否包含文字提示
|
|
63
61
|
|
|
62
|
+
// popConfirm 点击处理
|
|
63
|
+
const handleClick = async () => {
|
|
64
|
+
const _popConfirm = (await props.popConfirmBefore?.()) || props.popConfirm;
|
|
65
|
+
if (context.components) {
|
|
66
|
+
confirm({
|
|
67
|
+
..._popConfirm,
|
|
68
|
+
danger: props.danger
|
|
69
|
+
}, context.components);
|
|
70
|
+
} else {
|
|
71
|
+
Modal.confirm({
|
|
72
|
+
title: _popConfirm.title,
|
|
73
|
+
content: _popConfirm.content,
|
|
74
|
+
onOk: () => {
|
|
75
|
+
return _popConfirm.onConfirm?.();
|
|
76
|
+
},
|
|
77
|
+
onCancel: () => {
|
|
78
|
+
_popConfirm.onCancel?.();
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
|
|
64
84
|
// 排除不传递给 Button 的属性 (与 ES 原版 _excluded 一致)
|
|
65
85
|
const computedButtonProps = computed(() => {
|
|
66
86
|
const {
|
|
@@ -83,36 +103,64 @@ export default defineComponent({
|
|
|
83
103
|
disabled: isPermission.value
|
|
84
104
|
});
|
|
85
105
|
});
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
},
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
})
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
106
|
+
return (_ctx, _cache) => {
|
|
107
|
+
return _openBlock(), _createElementBlock(_Fragment, null, [_createCommentVNode(" 有权限 "), permission.value ? (_openBlock(), _createElementBlock(_Fragment, {
|
|
108
|
+
key: 0
|
|
109
|
+
}, [_createCommentVNode(" 有 tooltip "), hasTooltip.value ? (_openBlock(), _createBlock(_unref(Tooltip), _normalizeProps(_mergeProps({
|
|
110
|
+
key: 0
|
|
111
|
+
}, tooltipProps.value)), {
|
|
112
|
+
default: _withCtx(() => [_ctx.$slots.button ? _renderSlot(_ctx.$slots, "button", {
|
|
113
|
+
key: 0
|
|
114
|
+
}) : (_openBlock(), _createBlock(_unref(Button), _mergeProps({
|
|
115
|
+
key: 1
|
|
116
|
+
}, computedButtonProps.value, {
|
|
117
|
+
disabled: isPermission.value
|
|
118
|
+
}), _createSlots({
|
|
119
|
+
default: _withCtx(() => [_renderSlot(_ctx.$slots, "default")]),
|
|
120
|
+
_: 2 /* DYNAMIC */
|
|
121
|
+
}, [_ctx.$slots.icon ? {
|
|
122
|
+
name: "icon",
|
|
123
|
+
fn: _withCtx(() => [_renderSlot(_ctx.$slots, "icon")]),
|
|
124
|
+
key: "0"
|
|
125
|
+
} : undefined]), 1040 /* FULL_PROPS, DYNAMIC_SLOTS */, ["disabled"]))]),
|
|
126
|
+
_: 3 /* FORWARDED */
|
|
127
|
+
}, 16 /* FULL_PROPS */)) : (_openBlock(), _createElementBlock(_Fragment, {
|
|
128
|
+
key: 1
|
|
129
|
+
}, [_createCommentVNode(" 无 tooltip "), _ctx.$slots.button ? _renderSlot(_ctx.$slots, "button", {
|
|
130
|
+
key: 0
|
|
131
|
+
}) : (_openBlock(), _createBlock(_unref(Button), _mergeProps({
|
|
132
|
+
key: 1
|
|
133
|
+
}, computedButtonProps.value, {
|
|
134
|
+
disabled: isPermission.value
|
|
135
|
+
}), _createSlots({
|
|
136
|
+
default: _withCtx(() => [_renderSlot(_ctx.$slots, "default")]),
|
|
137
|
+
_: 2 /* DYNAMIC */
|
|
138
|
+
}, [_ctx.$slots.icon ? {
|
|
139
|
+
name: "icon",
|
|
140
|
+
fn: _withCtx(() => [_renderSlot(_ctx.$slots, "icon")]),
|
|
141
|
+
key: "0"
|
|
142
|
+
} : undefined]), 1040 /* FULL_PROPS, DYNAMIC_SLOTS */, ["disabled"]))], 64 /* STABLE_FRAGMENT */))], 64 /* STABLE_FRAGMENT */)) : (_openBlock(), _createElementBlock(_Fragment, {
|
|
143
|
+
key: 1
|
|
144
|
+
}, [_createCommentVNode(" 无权限 "), _createVNode(_unref(Tooltip), {
|
|
145
|
+
title: _ctx.noPermissionTitle || _unref(contextLocale)?.hasPermission
|
|
146
|
+
}, {
|
|
147
|
+
default: _withCtx(() => [_ctx.$slots.button ? _renderSlot(_ctx.$slots, "button", {
|
|
148
|
+
key: 0
|
|
149
|
+
}) : (_openBlock(), _createBlock(_unref(Button), _mergeProps({
|
|
150
|
+
key: 1
|
|
151
|
+
}, computedButtonProps.value, {
|
|
152
|
+
disabled: isPermission.value
|
|
153
|
+
}), _createSlots({
|
|
154
|
+
default: _withCtx(() => [_renderSlot(_ctx.$slots, "default")]),
|
|
155
|
+
_: 2 /* DYNAMIC */
|
|
156
|
+
}, [_ctx.$slots.icon ? {
|
|
157
|
+
name: "icon",
|
|
158
|
+
fn: _withCtx(() => [_renderSlot(_ctx.$slots, "icon")]),
|
|
159
|
+
key: "0"
|
|
160
|
+
} : undefined]), 1040 /* FULL_PROPS, DYNAMIC_SLOTS */, ["disabled"]))]),
|
|
161
|
+
_: 3 /* FORWARDED */
|
|
162
|
+
}, 8 /* PROPS */, ["title"])], 2112 /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */))], 2112 /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */);
|
|
116
163
|
};
|
|
117
164
|
}
|
|
118
|
-
});
|
|
165
|
+
});
|
|
166
|
+
export default __sfc_main__;
|