render-list.ts — vue Source File
Architecture documentation for render-list.ts, a typescript file in the vue codebase. 2 imports, 1 dependents.
Entity Profile
Dependency Diagram
graph LR c2ff008c_559b_74a2_2b1c_e73c7c5d0ac3["render-list.ts"] 90a2398a_1498_3263_c62e_0c064dd2c9b3["index"] c2ff008c_559b_74a2_2b1c_e73c7c5d0ac3 --> 90a2398a_1498_3263_c62e_0c064dd2c9b3 973389ac_8625_30a3_53ce_b1b48fae58c5["vnode"] c2ff008c_559b_74a2_2b1c_e73c7c5d0ac3 --> 973389ac_8625_30a3_53ce_b1b48fae58c5 8ffc8513_97a6_feaa_6bc2_e31c949e66cd["index.ts"] 8ffc8513_97a6_feaa_6bc2_e31c949e66cd --> c2ff008c_559b_74a2_2b1c_e73c7c5d0ac3 style c2ff008c_559b_74a2_2b1c_e73c7c5d0ac3 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import { isObject, isDef, hasSymbol, isArray } from 'core/util/index'
import VNode from 'core/vdom/vnode'
/**
* Runtime helper for rendering v-for lists.
*/
export function renderList(
val: any,
render: (val: any, keyOrIndex: string | number, index?: number) => VNode
): Array<VNode> | null {
let ret: Array<VNode> | null = null,
i,
l,
keys,
key
if (isArray(val) || typeof val === 'string') {
ret = new Array(val.length)
for (i = 0, l = val.length; i < l; i++) {
ret[i] = render(val[i], i)
}
} else if (typeof val === 'number') {
ret = new Array(val)
for (i = 0; i < val; i++) {
ret[i] = render(i + 1, i)
}
} else if (isObject(val)) {
if (hasSymbol && val[Symbol.iterator]) {
ret = []
const iterator: Iterator<any> = val[Symbol.iterator]()
let result = iterator.next()
while (!result.done) {
ret.push(render(result.value, ret.length))
result = iterator.next()
}
} else {
keys = Object.keys(val)
ret = new Array(keys.length)
for (i = 0, l = keys.length; i < l; i++) {
key = keys[i]
ret[i] = render(val[key], key, i)
}
}
}
if (!isDef(ret)) {
ret = []
}
;(ret as any)._isVList = true
return ret
}
Domain
Subdomains
Functions
Dependencies
- index
- vnode
Imported By
Source
Frequently Asked Questions
What does render-list.ts do?
render-list.ts is a source file in the vue codebase, written in typescript. It belongs to the VueCore domain, Instance subdomain.
What functions are defined in render-list.ts?
render-list.ts defines 1 function(s): renderList.
What does render-list.ts depend on?
render-list.ts imports 2 module(s): index, vnode.
What files import render-list.ts?
render-list.ts is imported by 1 file(s): index.ts.
Where is render-list.ts in the architecture?
render-list.ts is located at src/core/instance/render-helpers/render-list.ts (domain: VueCore, subdomain: Instance, directory: src/core/instance/render-helpers).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free