the element(s) to setup
Rest
...args: any[]the setup arguments
this same function to support chaining multiple setup calls.
Sets up the specified element(s) with the given arguments.
The values in args
are interpreted as follows:
Object.assign
This function is also used internally to set up new elements created with e.
Note that because of how Node appends work, any nodes args
will end up
appended only to the last element in elements
(if they are more than one).
Conversely, any fragments in args
will have their nodes only
appended to the first element in elements
.
the element(s) to setup
Rest
...args: any[]the setup arguments
this same function to support chaining multiple setup calls.
import { setup, e } from 'deleight/apriori';
const tree = document.querySelector('main');
setup(
main,
e.h1('Title',
h1 => console.log(h1, ' created')
),
e.section(
e.h2('Section 1'),
e.p(
'This is the first section',
{ className: 'text-centre' }
)
)
);
import { setup, e } from 'deleight/apriori';
const tree = document.querySelector('main');
setup(
main,
e.h1('Title',
h1 => console.log(h1, ' created')
),
e.section(
e.h2('Section 1'),
e.p(
'This is the first section',
{ className: 'text-centre' }
)
)
);
Sets up the specified element(s) with the given arguments.
The values in
args
are interpreted as follows:Object.assign
This function is also used internally to set up new elements created with e.
Note that because of how Node appends work, any nodes
args
will end up appended only to the last element inelements
(if they are more than one). Conversely, any fragments inargs
will have their nodes only appended to the first element inelements
.