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

Function patchProp

packages/runtime-test/src/patchProp.ts:4–22  ·  view source on GitHub ↗
(
  el: TestElement,
  key: string,
  prevValue: any,
  nextValue: any,
)

Source from the content-addressed store, hash-verified

2import { isOn } from '@vue/shared'
3
4export function patchProp(
5 el: TestElement,
6 key: string,
7 prevValue: any,
8 nextValue: any,
9): void {
10 logNodeOp({
11 type: NodeOpTypes.PATCH,
12 targetNode: el,
13 propKey: key,
14 propPrevValue: prevValue,
15 propNextValue: nextValue,
16 })
17 el.props[key] = nextValue
18 if (isOn(key)) {
19 const event = key[2] === ':' ? key.slice(3) : key.slice(2).toLowerCase()
20 ;(el.eventListeners || (el.eventListeners = {}))[event] = nextValue
21 }
22}

Callers

nothing calls this directly

Calls 2

logNodeOpFunction · 0.90
isOnFunction · 0.90

Tested by

no test coverage detected