-
-
Notifications
You must be signed in to change notification settings - Fork 78
Expand file tree
/
Copy pathViewEntry.vue
More file actions
63 lines (59 loc) · 1.63 KB
/
ViewEntry.vue
File metadata and controls
63 lines (59 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<script setup lang="ts">
import type { DevToolsDockEntry } from '@vitejs/devtools-kit'
import type { DocksContext } from '@vitejs/devtools-kit/client'
import type { CSSProperties } from 'vue'
import type { PersistedDomViewsManager } from '../utils/PersistedDomViewsManager'
import ViewBuiltinClientAuthNotice from './ViewBuiltinClientAuthNotice.vue'
import ViewBuiltinTerminals from './ViewBuiltinTerminals.vue'
import ViewCustomRenderer from './ViewCustomRenderer.vue'
import ViewIframe from './ViewIframe.vue'
import ViewLauncher from './ViewLauncher.vue'
defineProps<{
context: DocksContext
entry: DevToolsDockEntry
persistedDoms: PersistedDomViewsManager
iframeStyle?: CSSProperties
divStyle?: CSSProperties
}>()
</script>
<template>
<template v-if="entry.type === '~builtin'">
<ViewBuiltinTerminals
v-if="entry.id === '~terminals'"
:context
:entry
/>
<ViewBuiltinClientAuthNotice
v-else-if="entry.id === '~client-auth-notice'"
:context
/>
<div v-else>
Unknown builtin entry: {{ entry }}
</div>
</template>
<!-- Entry for Actions -->
<template v-else-if="entry.type === 'action'" />
<!-- User-defined entries -->
<ViewIframe
v-else-if="entry.type === 'iframe'"
:context
:entry
:persisted-doms="persistedDoms"
:iframe-style="iframeStyle"
/>
<ViewCustomRenderer
v-else-if="entry.type === 'custom-render'"
:context
:entry
:persisted-doms="persistedDoms"
:div-style="divStyle"
/>
<ViewLauncher
v-else-if="entry.type === 'launcher'"
:context
:entry
/>
<div v-else>
Unknown entry: {{ entry }}
</div>
</template>