-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathinspector.vue
59 lines (52 loc) · 1.39 KB
/
inspector.vue
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
<script setup lang="ts">
import { provide, ref, toRef, watch } from 'vue'
import NonBlock from './non-block.vue'
import Block from './block.vue'
import Status from './status.vue'
import Legends from './legends.vue'
const props = defineProps<{ data: any }>()
const data = toRef(props, 'data')
const current = ref()
provide('current', current)
const currentProp = ref('')
provide('currentProp', currentProp)
watch(data, () => {
current.value = undefined
currentProp.value = ''
})
// TODO:
// data.value.validations
// console.log(data.value.__debug__.pieces)
</script>
<template>
<div id="inspector">
<h2>Inspector</h2>
<div>
<h3>Origin</h3>
<pre class="linting-content"><template v-for="piece in data.__debug__.pieces"
><NonBlock v-if="'nonBlock' in piece" :data="piece"
/><Block v-else :data="piece" /></template
></pre>
</div>
<div>
<h3>Formatted</h3>
<pre class="linting-content"><template v-for="piece in data.__debug__.pieces"
><NonBlock v-if="'nonBlock' in piece" :data="piece"
/><Block v-else :data="piece" modified /></template
></pre>
</div>
<Status />
<Legends />
</div>
</template>
<style>
#inspector {
color: var(--vp-custom-block-details-text);
}
html #inspector .linting-content {
background-color: transparent;
}
html.dark #inspector .linting-content {
background-color: #EEE;
}
</style>