sh-view 2.4.17 → 2.4.19

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,6 +1,6 @@
1
1
  {
2
2
  "name": "sh-view",
3
- "version": "2.4.17",
3
+ "version": "2.4.19",
4
4
  "description": "基于vxe-table二次封装",
5
5
  "main": "packages/index.js",
6
6
  "scripts": {
@@ -1,13 +1,5 @@
1
1
  <template>
2
- <vxe-modal
3
- ref="modalRef"
4
- v-bind="modalConfig"
5
- @show="onModalShow"
6
- @hide="onModalHide"
7
- @zoom="onModalZoom"
8
- @close="onModalClose"
9
- @cancel="onModalClose"
10
- @confirm="onModalConfirm">
2
+ <vxe-modal ref="modalRef" v-bind="modalConfig" @show="onModalShow" @hide="onModalHide" @zoom="onModalZoom" @close="onModalClose" @cancel="onModalClose" @confirm="onModalConfirm">
11
3
  <template v-for="slot in Object.keys(slots)" #[slot]="scope">
12
4
  <!-- 以之前的名字命名插槽,同时把数据原样绑定 -->
13
5
  <slot :name="slot" v-bind="scope"></slot>
@@ -224,11 +224,14 @@ export default defineComponent({
224
224
  const isPagerSlot = computed(() => useTableHooks.tablePagerConfig.value.enabled)
225
225
  const isBottomSlot = computed(() => Boolean(slots.bottom))
226
226
 
227
- provide('ShTableInstance', reactive({
228
- columnObjConfig: useTableHooks.tableColumnObjConfig,
229
- turnColumnItemFilters: useTableHooks.turnColumnItemFilters,
230
- slots: useTableHooks.slots
231
- }))
227
+ provide(
228
+ 'ShTableInstance',
229
+ reactive({
230
+ columnObjConfig: useTableHooks.tableColumnObjConfig,
231
+ turnColumnItemFilters: useTableHooks.turnColumnItemFilters,
232
+ slots: useTableHooks.slots
233
+ })
234
+ )
232
235
 
233
236
  const handleResize = e => {
234
237
  if (useTableHooks.wrapHeight.value === 'auto') return
@@ -113,14 +113,17 @@ export default defineComponent({
113
113
  openedNames.value = []
114
114
  }
115
115
 
116
- provide('MenuInstance', reactive({
117
- props,
118
- activeName,
119
- activeNames,
120
- openedNames,
121
- onMenuSelect,
122
- onMenuExpand
123
- }))
116
+ provide(
117
+ 'MenuInstance',
118
+ reactive({
119
+ props,
120
+ activeName,
121
+ activeNames,
122
+ openedNames,
123
+ onMenuSelect,
124
+ onMenuExpand
125
+ })
126
+ )
124
127
 
125
128
  watch(
126
129
  () => props.modelValue,
@@ -169,10 +169,13 @@ export default defineComponent({
169
169
  emit('select', menu)
170
170
  }
171
171
 
172
- provide('MenuCardInstance', reactive({
173
- props,
174
- onMenuSelect
175
- }))
172
+ provide(
173
+ 'MenuCardInstance',
174
+ reactive({
175
+ props,
176
+ onMenuSelect
177
+ })
178
+ )
176
179
 
177
180
  return {
178
181
  cardActive,
@@ -8,12 +8,15 @@ export default function (props, context, state) {
8
8
  if (!props.src) return
9
9
  let container = rootRef.value
10
10
  try {
11
- let fileRes = null
12
11
  if (typeof props.src === 'string') {
13
- fileRes = await fetch(props.src, props.serverConfig)
12
+ fetch(props.src, props.serverConfig).then(async res => {
13
+ await state.domRender(res, container)
14
+ emit('rendered')
15
+ })
16
+ } else {
17
+ await state.domRender(props.src, container)
18
+ emit('rendered')
14
19
  }
15
- await state.domRender(fileRes, container)
16
- emit('rendered')
17
20
  } catch (e) {
18
21
  await state.domRender('', container)
19
22
  emit('error', e)