mirror of https://github.com/n2geoff/um
tweak tag export function
This commit is contained in:
parent
9bb54e38fe
commit
4760c611a3
|
@ -1,6 +1,5 @@
|
|||
import tag from "./tag.js";
|
||||
import h from "./tag.js";
|
||||
import app from "./app.js";
|
||||
|
||||
export {app};
|
||||
/** exports tag as h */
|
||||
export const h = tag;
|
||||
export {h};
|
||||
|
|
10
src/tag.js
10
src/tag.js
|
@ -1,12 +1,14 @@
|
|||
/**
|
||||
* Creates new DOM element(s) from tag name(s) and attributes
|
||||
* HTML Tag Scripting Function
|
||||
*
|
||||
* @param {string} tag - tag to create
|
||||
* @param {...any} args - attributes and/or child tag elements
|
||||
* creates new DOM element(s) from tag name(s) and attributes
|
||||
*
|
||||
* @param {String} tag - tag to create
|
||||
* @param {*} args - attributes and/or child tag elements
|
||||
*
|
||||
* @returns {HTMLElement} The created DOM element(s)
|
||||
*/
|
||||
export default function tag(tag, ...args) {
|
||||
export default function h(tag, ...args) {
|
||||
const el = document.createElement(tag);
|
||||
|
||||
// support all scalar values as TextNodes
|
||||
|
|
Loading…
Reference in New Issue