@taole/dev-helper 0.1.14 → 0.1.15

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.
@@ -48,10 +48,10 @@
48
48
  });
49
49
  }
50
50
  let id = 1;
51
- function defineTag() {
52
- customElements.define(
53
- "open-diandain-app",
54
- class extends HTMLElement {
51
+ const OPEN_DIANDIAN_TAG_NAMES = ['open-diandain-app', 'open-diandian-app'];
52
+
53
+ function createOpenDiandianElementClass() {
54
+ return class extends HTMLElement {
55
55
  static get observedAttributes() {
56
56
  return ['appid', 'extinfo', 'debug', 'scene'];
57
57
  }
@@ -367,8 +367,15 @@
367
367
  this._alink.href = this._alink_link;
368
368
  }
369
369
  }
370
- },
371
- );
370
+ };
371
+ }
372
+
373
+ function defineTag() {
374
+ OPEN_DIANDIAN_TAG_NAMES.forEach((tagName) => {
375
+ if (!customElements.get(tagName)) {
376
+ customElements.define(tagName, createOpenDiandianElementClass());
377
+ }
378
+ });
372
379
  }
373
380
 
374
381
  let isRegister = false;
@@ -43,10 +43,10 @@ function resolveTwKit() {
43
43
  });
44
44
  }
45
45
  let id = 1;
46
- function defineTag() {
47
- customElements.define(
48
- "open-diandain-app",
49
- class extends HTMLElement {
46
+ const OPEN_DIANDIAN_TAG_NAMES = ['open-diandain-app', 'open-diandian-app'];
47
+
48
+ function createOpenDiandianElementClass() {
49
+ return class extends HTMLElement {
50
50
  static get observedAttributes() {
51
51
  return ['appid', 'extinfo', 'debug', 'scene'];
52
52
  }
@@ -362,8 +362,15 @@ function defineTag() {
362
362
  this._alink.href = this._alink_link;
363
363
  }
364
364
  }
365
- },
366
- );
365
+ };
366
+ }
367
+
368
+ function defineTag() {
369
+ OPEN_DIANDIAN_TAG_NAMES.forEach((tagName) => {
370
+ if (!customElements.get(tagName)) {
371
+ customElements.define(tagName, createOpenDiandianElementClass());
372
+ }
373
+ });
367
374
  }
368
375
 
369
376
  let isRegister = false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taole/dev-helper",
3
- "version": "0.1.14",
3
+ "version": "0.1.15",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "dev-helper": "./bin/dev-helper.js"