@wevu/compiler 6.7.1 → 6.7.3

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.
Files changed (2) hide show
  1. package/dist/index.mjs +15 -6
  2. package/package.json +2 -2
package/dist/index.mjs CHANGED
@@ -528,6 +528,9 @@ function parseEventBinding$2(eventName) {
528
528
  name: eventName
529
529
  };
530
530
  }
531
+ function shouldUseColonEventBinding$2(name) {
532
+ return name.includes(":") || name.includes("-");
533
+ }
531
534
  /**
532
535
  * 百度智能小程序平台适配器。
533
536
  */
@@ -548,11 +551,11 @@ const swanPlatform = {
548
551
  eventBindingAttr: (eventName) => {
549
552
  const { prefix, name } = parseEventBinding$2(eventName);
550
553
  switch (prefix) {
551
- case "catch": return name.includes(":") ? `catch:${name}` : `catch${name}`;
554
+ case "catch": return shouldUseColonEventBinding$2(name) ? `catch:${name}` : `catch${name}`;
552
555
  case "capture-bind": return `capture-bind:${name}`;
553
556
  case "capture-catch": return `capture-catch:${name}`;
554
557
  case "mut-bind": return `mut-bind:${name}`;
555
- default: return name.includes(":") ? `bind:${name}` : `bind${name}`;
558
+ default: return shouldUseColonEventBinding$2(name) ? `bind:${name}` : `bind${name}`;
556
559
  }
557
560
  }
558
561
  };
@@ -592,6 +595,9 @@ function parseEventBinding$1(eventName) {
592
595
  name: eventName
593
596
  };
594
597
  }
598
+ function shouldUseColonEventBinding$1(name) {
599
+ return name.includes(":") || name.includes("-");
600
+ }
595
601
  /**
596
602
  * 抖音小程序平台适配器。
597
603
  */
@@ -612,11 +618,11 @@ const ttPlatform = {
612
618
  eventBindingAttr: (eventName) => {
613
619
  const { prefix, name } = parseEventBinding$1(eventName);
614
620
  switch (prefix) {
615
- case "catch": return name.includes(":") ? `catch:${name}` : `catch${name}`;
621
+ case "catch": return shouldUseColonEventBinding$1(name) ? `catch:${name}` : `catch${name}`;
616
622
  case "capture-bind": return `capture-bind:${name}`;
617
623
  case "capture-catch": return `capture-catch:${name}`;
618
624
  case "mut-bind": return `mut-bind:${name}`;
619
- default: return name.includes(":") ? `bind:${name}` : `bind${name}`;
625
+ default: return shouldUseColonEventBinding$1(name) ? `bind:${name}` : `bind${name}`;
620
626
  }
621
627
  }
622
628
  };
@@ -656,6 +662,9 @@ function parseEventBinding(eventName) {
656
662
  name: eventName
657
663
  };
658
664
  }
665
+ function shouldUseColonEventBinding(name) {
666
+ return name.includes(":") || name.includes("-");
667
+ }
659
668
  /**
660
669
  * 微信小程序平台适配器。
661
670
  */
@@ -676,11 +685,11 @@ const wechatPlatform = {
676
685
  eventBindingAttr: (eventName) => {
677
686
  const { prefix, name } = parseEventBinding(eventName);
678
687
  switch (prefix) {
679
- case "catch": return name.includes(":") ? `catch:${name}` : `catch${name}`;
688
+ case "catch": return shouldUseColonEventBinding(name) ? `catch:${name}` : `catch${name}`;
680
689
  case "capture-bind": return `capture-bind:${name}`;
681
690
  case "capture-catch": return `capture-catch:${name}`;
682
691
  case "mut-bind": return `mut-bind:${name}`;
683
- default: return name.includes(":") ? `bind:${name}` : `bind${name}`;
692
+ default: return shouldUseColonEventBinding(name) ? `bind:${name}` : `bind${name}`;
684
693
  }
685
694
  }
686
695
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@wevu/compiler",
3
3
  "type": "module",
4
- "version": "6.7.1",
4
+ "version": "6.7.3",
5
5
  "description": "wevu 编译器基础包,面向小程序模板的编译与转换",
6
6
  "author": "ice breaker <1324318532@qq.com>",
7
7
  "license": "MIT",
@@ -47,7 +47,7 @@
47
47
  "@babel/types": "^7.29.0",
48
48
  "@vue/compiler-core": "^3.5.29",
49
49
  "comment-json": "^4.6.2",
50
- "fs-extra": "^11.3.3",
50
+ "fs-extra": "^11.3.4",
51
51
  "lru-cache": "^11.2.6",
52
52
  "magic-string": "^0.30.21",
53
53
  "merge": "^2.1.1",