Skip to content

Commit e753d9c

Browse files
committed
refactor!: disable shortEmits in Vue 3.3
1 parent 1ec1b8b commit e753d9c

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

docs/macros/short-emits.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
Simplify the definition of emits.
66

7+
For Vue >= 3.3, this feature will be turned off by default.
8+
79
| Features | Supported |
810
| :--------: | :----------------: |
911
| Vue 3 | :white_check_mark: |

docs/zh-CN/macros/short-emits.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
<small>稳定性: <code class="!text-green-600">稳定</code></small>
44

5-
简化 `emits` 的定义
5+
简化 `emits` 的定义。
6+
7+
在 Vue >= 3.3 中,此功能将默认关闭。
68

79
| 特性 | 功能 |
810
| :--------: | :----------------: |

packages/macros/src/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,11 @@ function resolveOptions({
164164
root,
165165
}),
166166
setupSFC: resolveSubOptions<'setupSFC'>(setupSFC, { version }),
167-
shortEmits: resolveSubOptions<'shortEmits'>(shortEmits, { version }),
167+
shortEmits: resolveSubOptions<'shortEmits'>(
168+
shortEmits,
169+
{ version },
170+
version < 3.3
171+
),
168172
singleDefine: resolveSubOptions<'singleDefine'>(singleDefine, {
169173
isProduction,
170174
version,

0 commit comments

Comments
 (0)