false/null = no attr
This commit is contained in:
parent
56de9709e9
commit
6114e5cf5e
|
|
@ -77,10 +77,11 @@ 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}="${typeof value === 'function' ? (value as any).tagName : value}"`)
|
||||
const attrs = Object.entries(atNamed)
|
||||
.filter(([key, value]) => value)
|
||||
.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