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";
|
import app from "./app.js";
|
||||||
|
|
||||||
export {app};
|
export {app};
|
||||||
/** exports tag as h */
|
export {h};
|
||||||
export const h = tag;
|
|
||||||
|
|
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
|
* creates new DOM element(s) from tag name(s) and attributes
|
||||||
* @param {...any} args - attributes and/or child tag elements
|
*
|
||||||
|
* @param {String} tag - tag to create
|
||||||
|
* @param {*} args - attributes and/or child tag elements
|
||||||
*
|
*
|
||||||
* @returns {HTMLElement} The created DOM element(s)
|
* @returns {HTMLElement} The created DOM element(s)
|
||||||
*/
|
*/
|
||||||
export default function tag(tag, ...args) {
|
export default function h(tag, ...args) {
|
||||||
const el = document.createElement(tag);
|
const el = document.createElement(tag);
|
||||||
|
|
||||||
// support all scalar values as TextNodes
|
// support all scalar values as TextNodes
|
||||||
|
|
Loading…
Reference in New Issue