(instance: ComponentInternalInstance)
| 84 | } |
| 85 | |
| 86 | function formatInstance(instance: ComponentInternalInstance) { |
| 87 | const blocks = [] |
| 88 | if (instance.type.props && instance.props) { |
| 89 | blocks.push(createInstanceBlock('props', toRaw(instance.props))) |
| 90 | } |
| 91 | if (instance.setupState !== EMPTY_OBJ) { |
| 92 | blocks.push(createInstanceBlock('setup', instance.setupState)) |
| 93 | } |
| 94 | if (instance.data !== EMPTY_OBJ) { |
| 95 | blocks.push(createInstanceBlock('data', toRaw(instance.data))) |
| 96 | } |
| 97 | const computed = extractKeys(instance, 'computed') |
| 98 | if (computed) { |
| 99 | blocks.push(createInstanceBlock('computed', computed)) |
| 100 | } |
| 101 | const injected = extractKeys(instance, 'inject') |
| 102 | if (injected) { |
| 103 | blocks.push(createInstanceBlock('injected', injected)) |
| 104 | } |
| 105 | |
| 106 | blocks.push([ |
| 107 | 'div', |
| 108 | {}, |
| 109 | [ |
| 110 | 'span', |
| 111 | { |
| 112 | style: keywordStyle.style + ';opacity:0.66', |
| 113 | }, |
| 114 | '$ (internal): ', |
| 115 | ], |
| 116 | ['object', { object: instance }], |
| 117 | ]) |
| 118 | return blocks |
| 119 | } |
| 120 | |
| 121 | function createInstanceBlock(type: string, target: any) { |
| 122 | target = extend({}, target) |
no test coverage detected