dom-props.ts — vue Source File
Architecture documentation for dom-props.ts, a typescript file in the vue codebase. 7 imports, 1 dependents.
Entity Profile
Dependency Diagram
graph LR 6c8aaa22_3be8_0715_bdbe_23562ffc07d2["dom-props.ts"] f549c274_b375_8785_e025_a5d238ba23a1["attrs.ts"] 6c8aaa22_3be8_0715_bdbe_23562ffc07d2 --> f549c274_b375_8785_e025_a5d238ba23a1 d3df2209_4d64_4591_abc3_5711006984d0["renderAttr"] 6c8aaa22_3be8_0715_bdbe_23562ffc07d2 --> d3df2209_4d64_4591_abc3_5711006984d0 89eacf5c_deee_e42e_d519_69cb05e48e63["util.ts"] 6c8aaa22_3be8_0715_bdbe_23562ffc07d2 --> 89eacf5c_deee_e42e_d519_69cb05e48e63 953457f9_439e_4bfb_da0b_a8f1356764a0["isRenderableAttr"] 6c8aaa22_3be8_0715_bdbe_23562ffc07d2 --> 953457f9_439e_4bfb_da0b_a8f1356764a0 973389ac_8625_30a3_53ce_b1b48fae58c5["vnode"] 6c8aaa22_3be8_0715_bdbe_23562ffc07d2 --> 973389ac_8625_30a3_53ce_b1b48fae58c5 09aa5370_2caa_6b33_3f44_6ac5211bd11b["util"] 6c8aaa22_3be8_0715_bdbe_23562ffc07d2 --> 09aa5370_2caa_6b33_3f44_6ac5211bd11b ba925ef2_b0f4_efe3_c23d_fe293c46b2c1["vnode"] 6c8aaa22_3be8_0715_bdbe_23562ffc07d2 --> ba925ef2_b0f4_efe3_c23d_fe293c46b2c1 541324d1_64ab_2ed6_961a_c199b29f9df6["index.ts"] 541324d1_64ab_2ed6_961a_c199b29f9df6 --> 6c8aaa22_3be8_0715_bdbe_23562ffc07d2 style 6c8aaa22_3be8_0715_bdbe_23562ffc07d2 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import VNode from 'core/vdom/vnode'
import { renderAttr } from './attrs'
import { isDef, isUndef, extend, toString } from 'shared/util'
import { propsToAttrMap, isRenderableAttr } from '../util'
import type { VNodeWithData } from 'types/vnode'
export default function renderDOMProps(node: VNodeWithData): string {
let props = node.data.domProps
let res = ''
let parent = node.parent
while (isDef(parent)) {
if (parent.data && parent.data.domProps) {
props = extend(extend({}, props), parent.data.domProps)
}
parent = parent.parent
}
if (isUndef(props)) {
return res
}
const attrs = node.data.attrs
for (const key in props) {
if (key === 'innerHTML') {
setText(node, props[key], true)
} else if (key === 'textContent') {
setText(node, props[key], false)
} else if (key === 'value' && node.tag === 'textarea') {
setText(node, toString(props[key]), false)
} else {
// $flow-disable-line (WTF?)
const attr = propsToAttrMap[key] || key.toLowerCase()
if (
isRenderableAttr(attr) &&
// avoid rendering double-bound props/attrs twice
!(isDef(attrs) && isDef(attrs[attr]))
) {
res += renderAttr(attr, props[key])
}
}
}
return res
}
function setText(node, text, raw) {
const child = new VNode(undefined, undefined, undefined, text)
child.raw = raw
node.children = [child]
}
Domain
Subdomains
Functions
Dependencies
- attrs.ts
- isRenderableAttr
- renderAttr
- util
- util.ts
- vnode
- vnode
Imported By
Source
Frequently Asked Questions
What does dom-props.ts do?
dom-props.ts is a source file in the vue codebase, written in typescript. It belongs to the ServerRenderer domain, BundleRenderer subdomain.
What functions are defined in dom-props.ts?
dom-props.ts defines 2 function(s): renderDOMProps, setText.
What does dom-props.ts depend on?
dom-props.ts imports 7 module(s): attrs.ts, isRenderableAttr, renderAttr, util, util.ts, vnode, vnode.
What files import dom-props.ts?
dom-props.ts is imported by 1 file(s): index.ts.
Where is dom-props.ts in the architecture?
dom-props.ts is located at packages/server-renderer/src/modules/dom-props.ts (domain: ServerRenderer, subdomain: BundleRenderer, directory: packages/server-renderer/src/modules).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free