mirror of https://github.com/vuejs/core.git
refactor(compiler-sfc): defineOptions avoid redundant conditional judgments (#9453)
This commit is contained in:
parent
baa656ee41
commit
56f5692fb6
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue