|
1 | 1 | <script setup lang="ts"> |
| 2 | +import { toRaw } from 'vue' |
2 | 3 | import { VueButton, VueDropdown, VueDropdownButton, VueIcon, VTooltip as vTooltip } from '@vue/devtools-ui' |
3 | 4 | import { getRawValue } from '@vue/devtools-kit' |
4 | 5 | import type { InspectorState, InspectorStateEditorPayload } from '@vue/devtools-kit' |
@@ -49,7 +50,7 @@ function quickEdit(v: unknown, remove: boolean = false) { |
49 | 50 | nodeId: state.value.nodeId, |
50 | 51 | state: { |
51 | 52 | newKey: null!, |
52 | | - value: v, |
| 53 | + value: toRaw(v), |
53 | 54 | type: dataType.value, |
54 | 55 | remove, |
55 | 56 | }, |
@@ -95,20 +96,20 @@ function quickEdit(v: unknown, remove: boolean = false) { |
95 | 96 | </VueButton> |
96 | 97 | <!-- increment/decrement button, numeric value only --> |
97 | 98 | <template v-else-if="dataType === 'number'"> |
98 | | - <VueButton v-bind="iconButtonProps" :class="buttonClass" @click="quickEdit((rawValue as number) + 1)"> |
| 99 | + <VueButton v-bind="iconButtonProps" :class="buttonClass" @click.stop="quickEdit((rawValue as number) + 1)"> |
99 | 100 | <template #icon> |
100 | 101 | <VueIcon icon="i-carbon-add" /> |
101 | 102 | </template> |
102 | 103 | </VueButton> |
103 | | - <VueButton v-bind="iconButtonProps" :class="buttonClass" @click="quickEdit((rawValue as number) - 1)"> |
| 104 | + <VueButton v-bind="iconButtonProps" :class="buttonClass" @click.stop="quickEdit((rawValue as number) - 1)"> |
104 | 105 | <template #icon> |
105 | 106 | <VueIcon icon="i-carbon-subtract" /> |
106 | 107 | </template> |
107 | 108 | </VueButton> |
108 | 109 | </template> |
109 | 110 | </template> |
110 | 111 | <!-- delete prop, only appear if depth > 0 --> |
111 | | - <VueButton v-if="!props.disableEdit && depth > 0" v-bind="iconButtonProps" :class="buttonClass" @click="quickEdit(rawValue, true)"> |
| 112 | + <VueButton v-if="!props.disableEdit && depth > 0" v-bind="iconButtonProps" :class="buttonClass" @click.stop="quickEdit(rawValue, true)"> |
112 | 113 | <template #icon> |
113 | 114 | <VueIcon icon="i-material-symbols-delete-rounded" /> |
114 | 115 | </template> |
|
0 commit comments