sh-view 2.4.12 → 2.4.14

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.12",
3
+ "version": "2.4.14",
4
4
  "description": "基于vxe-table二次封装",
5
5
  "main": "packages/index.js",
6
6
  "scripts": {
@@ -5,15 +5,9 @@
5
5
  </template>
6
6
 
7
7
  <script>
8
- import { defineComponent, computed } from 'vue'
9
- import ShWord from './components/sh-word.vue'
10
- import ShExcel from './components/sh-excel.vue'
8
+ import { defineComponent, computed, defineAsyncComponent } from 'vue'
11
9
  export default defineComponent({
12
10
  name: 'ShPreview',
13
- components: {
14
- ShWord,
15
- ShExcel
16
- },
17
11
  props: {
18
12
  type: {
19
13
  type: String
@@ -39,9 +33,9 @@ export default defineComponent({
39
33
  const previewType = computed(() => (props.type && props.type.toLowerCase()) || (props.url && props.url.substr(props.url.lastIndexOf('.') + 1).toLowerCase()))
40
34
  const componentName = computed(() => {
41
35
  if (['word', 'doc', 'docx'].includes(previewType.value)) {
42
- return 'ShWord'
36
+ return defineAsyncComponent(() => import('./components/sh-word.vue'))
43
37
  } else if (['excel', 'xlsx'].includes(previewType.value)) {
44
- return 'ShExcel'
38
+ return defineAsyncComponent(() => import('./components/sh-excel.vue'))
45
39
  }
46
40
  return 'iframe'
47
41
  })