Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(compiler-sfc): defineOptions avoid redundant conditional judgments #9453

Merged
merged 26 commits into from
May 27, 2024
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
94a97d1
perf(compiler-sfc): defineOptions avoid redundant conditional judgments
Simon-He95 Oct 21, 2023
2a1cce6
refactor: with switch syntax
Simon-He95 Oct 23, 2023
d772fca
Merge branch 'main' into main
Simon-He95 Oct 23, 2023
a369c31
Merge branch 'main' into main
Simon-He95 Oct 23, 2023
3cf8afd
Merge branch 'main' into main
Simon-He95 Oct 24, 2023
37eda01
Merge branch 'main' into main
Simon-He95 Oct 24, 2023
ee73fc7
Merge branch 'main' into main
Simon-He95 Oct 24, 2023
2e96b39
Merge branch 'main' into main
Simon-He95 Oct 24, 2023
6ca5dde
Merge branch 'main' into main
Simon-He95 Oct 26, 2023
17e52c8
Merge branch 'main' into main
Simon-He95 Oct 29, 2023
002bc90
Merge branch 'main' into main
Simon-He95 Oct 30, 2023
2b8d3ca
Merge branch 'main' into main
Simon-He95 Nov 1, 2023
e2b887e
Merge branch 'main' into main
Simon-He95 Nov 3, 2023
6863164
Merge branch 'main' into main
Simon-He95 Nov 6, 2023
34f26f4
Merge branch 'main' into main
Simon-He95 Nov 12, 2023
3461126
Merge branch 'main' into main
Simon-He95 Nov 15, 2023
a9dfa6f
Merge branch 'main' into main
Simon-He95 Nov 20, 2023
9481c8b
Merge branch 'main' into main
Simon-He95 Nov 22, 2023
371cd95
Merge branch 'main' into main
Simon-He95 Nov 24, 2023
3ae266a
Merge branch 'main' into main
Simon-He95 Nov 25, 2023
890d031
Merge branch 'main' into main
Simon-He95 Dec 4, 2023
3910954
Merge branch 'main' into main
Simon-He95 Dec 11, 2023
df17f0d
Merge branch 'vuejs:main' into main
Simon-He95 Jan 25, 2024
11cbcb9
Merge branch 'main' into main
Simon-He95 Apr 18, 2024
778200f
Merge branch 'main' into main
Simon-He95 Apr 18, 2024
7dafa72
Merge branch 'main' into main
Simon-He95 Apr 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions packages/compiler-sfc/src/script/defineOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,23 @@ export function processDefineOptions(
(prop.type === 'ObjectProperty' || prop.type === 'ObjectMethod') &&
prop.key.type === 'Identifier'
) {
if (prop.key.name === 'props') propsOption = prop
if (prop.key.name === 'emits') emitsOption = prop
if (prop.key.name === 'expose') exposeOption = prop
if (prop.key.name === 'slots') slotsOption = prop
switch (prop.key.name) {
case 'props':
propsOption = prop
break

case 'emits':
emitsOption = prop
break

case 'expose':
exposeOption = prop
break

case 'slots':
slotsOption = prop
break
}
}
}
}
Expand Down