diff --git a/core/client/components/document/KBrowser.vue b/core/client/components/document/KBrowser.vue new file mode 100644 index 000000000..34847570a --- /dev/null +++ b/core/client/components/document/KBrowser.vue @@ -0,0 +1,103 @@ + + + + + + {{ document.name }} + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/core/client/components/document/KDocument.vue b/core/client/components/document/KDocument.vue index 6297c38ae..12d4bb802 100644 --- a/core/client/components/document/KDocument.vue +++ b/core/client/components/document/KDocument.vue @@ -19,7 +19,7 @@ const props = defineProps({ type: String, default: null }, - mimeType: { + type: { type: String, default: null }, @@ -35,15 +35,15 @@ const props = defineProps({ // Computed const viewer = computed(() => { - const mimeType = props.mimeType || guessMimeType() - if (!mimeType) return null - const viewer = _.get(Document.options, `viewers.${mimeType}`) + const type = props.type || guessType() + if (!type) return null + const viewer = _.get(Document.options, `viewers.${type}`) if (!viewer) return null return loadComponent(viewer) }) // Function -function guessMimeType () { +function guessType () { if (!props.url) return null const index = _.lastIndexOf(props.url, '.') if (!index) return null diff --git a/core/client/components/document/KHtml.vue b/core/client/components/document/KHtml.vue index ca3873aa1..bf4641256 100644 --- a/core/client/components/document/KHtml.vue +++ b/core/client/components/document/KHtml.vue @@ -1,8 +1,10 @@ - + + +