From c34125824127843910cfcbafa6691905e4826dbe Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Tue, 1 Mar 2022 16:52:01 +0800 Subject: [PATCH] style: update mentions --- components/mentions/index.en-US.md | 2 +- components/mentions/index.tsx | 4 ++-- components/mentions/style/index.less | 2 ++ components/mentions/style/{index.ts => index.tsx} | 0 4 files changed, 5 insertions(+), 3 deletions(-) rename components/mentions/style/{index.ts => index.tsx} (100%) diff --git a/components/mentions/index.en-US.md b/components/mentions/index.en-US.md index ed3f9e5ac..a58d8a1fe 100644 --- a/components/mentions/index.en-US.md +++ b/components/mentions/index.en-US.md @@ -9,7 +9,7 @@ Mention component. ## When To Use -- When need to mention someone or something. +When you need to mention someone or something. ## API diff --git a/components/mentions/index.tsx b/components/mentions/index.tsx index 5e29d7286..81089b4ac 100644 --- a/components/mentions/index.tsx +++ b/components/mentions/index.tsx @@ -29,8 +29,8 @@ interface MentionsEntity { export type MentionPlacement = 'top' | 'bottom'; -const getMentions = (value = '', config: MentionsConfig): MentionsEntity[] => { - const { prefix = '@', split = ' ' } = config || {}; +const getMentions = (value = '', config: MentionsConfig = {}): MentionsEntity[] => { + const { prefix = '@', split = ' ' } = config; const prefixList: string[] = Array.isArray(prefix) ? prefix : [prefix]; return value diff --git a/components/mentions/style/index.less b/components/mentions/style/index.less index d2285d943..c18683fca 100644 --- a/components/mentions/style/index.less +++ b/components/mentions/style/index.less @@ -37,6 +37,7 @@ overflow: inherit; overflow-x: hidden; overflow-y: auto; + /* stylelint-disable declaration-block-no-redundant-longhand-properties */ font-weight: inherit; font-size: inherit; font-family: inherit; @@ -45,6 +46,7 @@ font-size-adjust: inherit; font-stretch: inherit; line-height: inherit; + /* stylelint-enable declaration-block-no-redundant-longhand-properties */ direction: inherit; letter-spacing: inherit; white-space: inherit; diff --git a/components/mentions/style/index.ts b/components/mentions/style/index.tsx similarity index 100% rename from components/mentions/style/index.ts rename to components/mentions/style/index.tsx