MCPcopy Create free account
hub / github.com/Xu22Web/tech-study-js / handleProps

Function handleProps

tech-study.js:1431–1442  ·  view source on GitHub ↗

* @description 处理属性 * @param ele * @param props

(ele, props)

Source from the content-addressed store, hash-verified

1429 * @param props
1430 */
1431function handleProps(ele, props) {
1432 // props属性设置
1433 for (const key in props) {
1434 // Ref 属性
1435 if (isRef(props[key])) {
1436 const refVal = props[key];
1437 watchEffect(() => (ele[key] = refVal.value));
1438 continue;
1439 }
1440 ele[key] = props[key];
1441 }
1442}
1443/**
1444 * @description 处理svg属性
1445 * @param ele

Callers 2

createElementNodeFunction · 0.70
createNSElementNodeFunction · 0.70

Calls 2

isRefFunction · 0.70
watchEffectFunction · 0.70

Tested by

no test coverage detected