MCPcopy
hub / github.com/vuejs/core / createInstanceBlock

Function createInstanceBlock

packages/runtime-core/src/customFormatter.ts:121–151  ·  view source on GitHub ↗
(type: string, target: any)

Source from the content-addressed store, hash-verified

119 }
120
121 function createInstanceBlock(type: string, target: any) {
122 target = extend({}, target)
123 if (!Object.keys(target).length) {
124 return ['span', {}]
125 }
126 return [
127 'div',
128 { style: 'line-height:1.25em;margin-bottom:0.6em' },
129 [
130 'div',
131 {
132 style: 'color:#476582',
133 },
134 type,
135 ],
136 [
137 'div',
138 {
139 style: 'padding-left:1.25em',
140 },
141 ...Object.keys(target).map(key => {
142 return [
143 'div',
144 {},
145 ['span', keywordStyle, key + ': '],
146 formatValue(target[key], false),
147 ]
148 }),
149 ],
150 ]
151 }
152
153 function formatValue(v: unknown, asRaw = true) {
154 if (typeof v === 'number') {

Callers 1

formatInstanceFunction · 0.85

Calls 2

formatValueFunction · 0.85
mapMethod · 0.80

Tested by

no test coverage detected