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

Function setElementText

packages/runtime-test/src/nodeOps.ts:195–216  ·  view source on GitHub ↗
(el: TestElement, text: string)

Source from the content-addressed store, hash-verified

193}
194
195function setElementText(el: TestElement, text: string): void {
196 logNodeOp({
197 type: NodeOpTypes.SET_ELEMENT_TEXT,
198 targetNode: el,
199 text,
200 })
201 el.children.forEach(c => {
202 c.parentNode = null
203 })
204 if (!text) {
205 el.children = []
206 } else {
207 el.children = [
208 {
209 id: nodeId++,
210 type: TestNodeTypes.TEXT,
211 text,
212 parentNode: el,
213 },
214 ]
215 }
216}
217
218function parentNode(node: TestNode): TestElement | null {
219 return node.parentNode

Callers

nothing calls this directly

Calls 2

logNodeOpFunction · 0.85
forEachMethod · 0.80

Tested by

no test coverage detected