1.0.0 • Published 9 months ago

@jtorm/swap-method v1.0.0

Weekly downloads
-
License
GPL-3.0
Repository
gitlab
Last release
9 months ago

jTorm Swap Method

Replace a tag for an other tag.

Install

npm install @jtorm/swap-method

Properties

OptionTypeRequiredDescription
sstringtrueCSS Selector of target element added through ui, or h, or as a fallback it will create an element based on the selector.
uistringfalseUI component.
hstringfalseHTML.
abooleanfalseKeep attributes.

Example

h1->swap {
  s: 'h2';
  a: 1;
}
h1->swap {
  s: 'h2';
  ui: 'typography.h2';
  a: 1;
}
h1->swap {
  s: 'h2';
  h: '<h2 id="h2-1" class="h2"></h2>';
  a: 0;
  h2->attr {
    n: 'class';
    v: 'schema-name';
    m: 'a';
  }
}
1.0.0

9 months ago

0.0.4

2 years ago

0.0.3

3 years ago

0.0.2

3 years ago