From 569e8c5fa8cffd1e7e9d1fbe89ace8e762e6061a Mon Sep 17 00:00:00 2001 From: dalston Date: Thu, 11 Jun 2020 16:59:22 +0800 Subject: [PATCH] fix: enum2options label key --- src/select/enum2options.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/select/enum2options.ts b/src/select/enum2options.ts index 2e46bcb..2c2eaf1 100644 --- a/src/select/enum2options.ts +++ b/src/select/enum2options.ts @@ -11,8 +11,8 @@ function enum2Options(enumObj: object, labelName: string = 'label', valueName: s return (Object.keys(enumObj) .filter(key => isNaN(Number(key))) || []) .map(key => ({ - [labelName]: enumObj[key], - [valueName]: key + [labelName]: key, + [valueName]: enumObj[key] })) }