MCPcopy
hub / github.com/wavetermdev/waveterm / E

Function E

pkg/vdom/vdom.go:169–198  ·  view source on GitHub ↗
(tag string, parts ...any)

Source from the content-addressed store, hash-verified

167}
168
169func E(tag string, parts ...any) *VDomElem {
170 rtn := &VDomElem{Tag: tag}
171 for _, part := range parts {
172 if part == nil {
173 continue
174 }
175 props, ok := part.(map[string]any)
176 if ok {
177 mergeProps(&rtn.Props, props)
178 continue
179 }
180 if styleAttr, ok := part.(styleAttrWrapper); ok {
181 mergeStyleAttr(&rtn.Props, styleAttr)
182 continue
183 }
184 if styleAttrMap, ok := part.(styleAttrMapWrapper); ok {
185 for k, v := range styleAttrMap.StyleAttrMap {
186 mergeStyleAttr(&rtn.Props, styleAttrWrapper{StyleAttr: k, Val: v})
187 }
188 continue
189 }
190 if classAttr, ok := part.(classAttrWrapper); ok {
191 mergeClassAttr(&rtn.Props, classAttr)
192 continue
193 }
194 elems := partToElems(part)
195 rtn.Children = append(rtn.Children, elems...)
196 }
197 return rtn
198}
199
200func Class(name string) classAttrWrapper {
201 return classAttrWrapper{ClassName: name, Cond: true}

Callers 3

MakeClientFunction · 0.92
DefineComponentFunction · 0.92
Test1Function · 0.85

Calls 4

mergePropsFunction · 0.85
mergeStyleAttrFunction · 0.85
mergeClassAttrFunction · 0.85
partToElemsFunction · 0.85

Tested by 1

Test1Function · 0.68