diff --git a/dolphinscheduler-ui/src/utils/trim.ts b/dolphinscheduler-ui/src/utils/trim.ts index d7f731bcd2..e08bf84c95 100644 --- a/dolphinscheduler-ui/src/utils/trim.ts +++ b/dolphinscheduler-ui/src/utils/trim.ts @@ -19,4 +19,8 @@ const trim = (value: string) => { return !value.startsWith(' ') && !value.endsWith(' ') } +export const noSpace = (value: string) => { + return value.indexOf(' ') === -1 +} + export default trim diff --git a/dolphinscheduler-ui/src/views/resource/file/folder/index.tsx b/dolphinscheduler-ui/src/views/resource/file/folder/index.tsx index 2fa0824c9a..cb48569ba4 100644 --- a/dolphinscheduler-ui/src/views/resource/file/folder/index.tsx +++ b/dolphinscheduler-ui/src/views/resource/file/folder/index.tsx @@ -19,6 +19,7 @@ import { defineComponent, toRefs, PropType, getCurrentInstance } from 'vue' import { NForm, NFormItem, NInput } from 'naive-ui' import { useI18n } from 'vue-i18n' import Modal from '@/components/modal' +import { noSpace } from '@/utils/trim' import { useForm } from './use-form' import { useFolder } from './use-folder' @@ -69,7 +70,7 @@ export default defineComponent({