sh-view 2.4.5 → 2.4.7
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/package.json
CHANGED
|
@@ -1,29 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<vxe-modal
|
|
3
|
-
:id="id"
|
|
4
3
|
ref="modalRef"
|
|
5
|
-
v-
|
|
6
|
-
:title="title"
|
|
7
|
-
:size="size"
|
|
8
|
-
:class-name="className"
|
|
9
|
-
:width="width"
|
|
10
|
-
:height="height"
|
|
11
|
-
:type="type"
|
|
12
|
-
:status="status"
|
|
13
|
-
:loading="loading"
|
|
14
|
-
:destroy-on-close="destroyOnClose"
|
|
15
|
-
:transfer="transfer"
|
|
16
|
-
:fullscreen="fullscreen"
|
|
17
|
-
:show-header="showHeader"
|
|
18
|
-
:show-zoom="showZoom"
|
|
19
|
-
:show-close="showClose"
|
|
20
|
-
:show-footer="showFooter"
|
|
21
|
-
:resize="resize"
|
|
22
|
-
:mask="mask"
|
|
23
|
-
:mask-closable="maskClosable"
|
|
24
|
-
:esc-closable="escClosable"
|
|
25
|
-
:position="position"
|
|
26
|
-
:before-hide-method="beforeHideMethod"
|
|
4
|
+
v-bind="modalConfig"
|
|
27
5
|
@show="onModalShow"
|
|
28
6
|
@hide="onModalHide"
|
|
29
7
|
@zoom="onModalZoom"
|
|
@@ -49,11 +27,11 @@
|
|
|
49
27
|
</template>
|
|
50
28
|
|
|
51
29
|
<script>
|
|
52
|
-
import { defineComponent, watch, ref } from 'vue'
|
|
30
|
+
import { defineComponent, watch, ref, computed, getCurrentInstance } from 'vue'
|
|
53
31
|
export default defineComponent({
|
|
54
32
|
name: 'ShModal',
|
|
55
33
|
props: {
|
|
56
|
-
|
|
34
|
+
modelValue: {
|
|
57
35
|
type: Boolean
|
|
58
36
|
},
|
|
59
37
|
id: {
|
|
@@ -147,11 +125,17 @@ export default defineComponent({
|
|
|
147
125
|
default: '取消'
|
|
148
126
|
}
|
|
149
127
|
},
|
|
150
|
-
emits: ['show', 'hide', 'zoom', 'confirm', 'close'
|
|
128
|
+
emits: ['update:modelValue', 'show', 'hide', 'zoom', 'confirm', 'close'],
|
|
151
129
|
setup(props, context) {
|
|
130
|
+
const { proxy } = getCurrentInstance()
|
|
131
|
+
const { $vUtils } = proxy
|
|
152
132
|
const { emit, slots } = context
|
|
153
133
|
const modalRef = ref()
|
|
154
|
-
|
|
134
|
+
|
|
135
|
+
const modalConfig = computed(() => {
|
|
136
|
+
let modelProps = $vUtils.omit(props, ['readonly', 'confirmButtonText', 'cancelButtonText'])
|
|
137
|
+
return $vUtils.omit(modelProps, val => val === undefined)
|
|
138
|
+
})
|
|
155
139
|
|
|
156
140
|
// 弹窗显示回调
|
|
157
141
|
const onModalShow = () => {
|
|
@@ -172,26 +156,20 @@ export default defineComponent({
|
|
|
172
156
|
// 取消操作
|
|
173
157
|
const onModalClose = () => {
|
|
174
158
|
emit('close')
|
|
175
|
-
emit('update:
|
|
159
|
+
emit('update:modelValue', false)
|
|
176
160
|
}
|
|
177
161
|
|
|
178
162
|
watch(
|
|
179
|
-
() =>
|
|
180
|
-
value => {
|
|
181
|
-
modalVisible.value = value
|
|
182
|
-
}
|
|
183
|
-
)
|
|
184
|
-
watch(
|
|
185
|
-
() => modalVisible.value,
|
|
163
|
+
() => modalConfig.value.modelValue,
|
|
186
164
|
value => {
|
|
187
165
|
if (!value) onModalClose()
|
|
188
166
|
}
|
|
189
167
|
)
|
|
190
168
|
|
|
191
169
|
return {
|
|
192
|
-
modalRef,
|
|
193
170
|
slots,
|
|
194
|
-
|
|
171
|
+
modalRef,
|
|
172
|
+
modalConfig,
|
|
195
173
|
onModalShow,
|
|
196
174
|
onModalHide,
|
|
197
175
|
onModalZoom,
|