dirty
This commit is contained in:
parent
c7fed4bac6
commit
201cba6542
|
|
@ -56,6 +56,7 @@ for (const name of HTML5_TAGS) {
|
|||
(ribbitGlobals as any)[name] = (atNamed: {}, ...args: any[]) => tag(name, atNamed, ...args)
|
||||
; (ribbitGlobals as any)[name].tagName = name
|
||||
}
|
||||
; (ribbitGlobals as any)['text'].tagName = 'text'
|
||||
|
||||
const tag = async (tagName: string, atNamed = {}, ...args: any[]) => {
|
||||
if (typeof args[0] === 'function')
|
||||
|
|
@ -76,9 +77,10 @@ const tagBlock = async (tagName: string, props = {}, fn: Function) => {
|
|||
}
|
||||
|
||||
const tagCall = (tagName: string, atNamed = {}, ...args: any[]) => {
|
||||
console.log('tagCall:', { tagName, atNamed, args })
|
||||
args = args.map(arg => typeof arg === 'function' ? arg.tagName : arg)
|
||||
|
||||
const attrs = Object.entries(atNamed).map(([key, value]) => `${key}="${value}"`)
|
||||
const attrs = Object.entries(atNamed).map(([key, value]) => `${key}="${typeof value === 'function' ? (value as any).tagName : value}"`)
|
||||
const space = attrs.length ? ' ' : ''
|
||||
const children = args
|
||||
.reverse()
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user