MCPcopy
hub / github.com/vuejs/devtools-v6 / editComponentState

Function editComponentState

packages/app-backend-core/src/component.ts:100–112  ·  view source on GitHub ↗
(instanceId: string, dotPath: string, type: string, state: EditStatePayload, ctx: BackendContext)

Source from the content-addressed store, hash-verified

98}
99
100export async function editComponentState(instanceId: string, dotPath: string, type: string, state: EditStatePayload, ctx: BackendContext) {
101 if (!instanceId) {
102 return
103 }
104 const instance = getComponentInstance(ctx.currentAppRecord, instanceId, ctx)
105 if (instance) {
106 if ('value' in state && state.value != null) {
107 state.value = parse(state.value, true)
108 }
109 await ctx.currentAppRecord.backend.api.editComponentState(instance, dotPath, type, state, ctx.currentAppRecord.options.app)
110 await sendSelectedComponentData(ctx.currentAppRecord, instanceId, ctx)
111 }
112}
113
114export async function getComponentId(app: App, uid: number, instance: ComponentInstance, ctx: BackendContext) {
115 try {

Callers 1

connectBridgeFunction · 0.90

Calls 4

parseFunction · 0.90
getComponentInstanceFunction · 0.85
editComponentStateMethod · 0.45

Tested by

no test coverage detected