@taole/dev-helper 0.1.5 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Tdiv/index.js CHANGED
@@ -273,16 +273,14 @@ class Tdiv extends HTMLElement {
273
273
 
274
274
 
275
275
 
276
- let isRegister = false;
277
276
  function registerTdiv() {
278
- if (!isRegister) {
279
- customElements.define('t-div', Tdiv);
280
- // append style for t-div
281
- const style = document.createElement('style');
282
- style.textContent = styleText;
283
- document.head.appendChild(style);
284
- isRegister = true;
277
+ if (customElements.get('t-div')) {
278
+ return;
285
279
  }
280
+ customElements.define('t-div', Tdiv);
281
+ const style = document.createElement('style');
282
+ style.textContent = styleText;
283
+ document.head.appendChild(style);
286
284
  }
287
285
 
288
286
  registerTdiv();
package/dist/tdiv.umd.js CHANGED
@@ -357,16 +357,14 @@
357
357
 
358
358
 
359
359
 
360
- let isRegister = false;
361
360
  function registerTdiv() {
362
- if (!isRegister) {
363
- customElements.define('t-div', Tdiv);
364
- // append style for t-div
365
- const style = document.createElement('style');
366
- style.textContent = styleText;
367
- document.head.appendChild(style);
368
- isRegister = true;
361
+ if (customElements.get('t-div')) {
362
+ return;
369
363
  }
364
+ customElements.define('t-div', Tdiv);
365
+ const style = document.createElement('style');
366
+ style.textContent = styleText;
367
+ document.head.appendChild(style);
370
368
  }
371
369
 
372
370
  registerTdiv();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taole/dev-helper",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "build": "npx -y rimraf dist && rollup -c",