vben
2020-12-01 962f90de445d7935ad76ea7b74a98f12ce9a7498
src/components/Form/src/helper.ts
@@ -1,17 +1,17 @@
import type { ComponentType } from './types/index';
import { useI18n } from '/@/hooks/web/useI18n';
const { t } = useI18n('component.form');
const { t } = useI18n();
/**
 * @description: 生成placeholder
 */
export function createPlaceholderMessage(component: ComponentType) {
  if (component.includes('Input') || component.includes('Complete')) {
    return t('input');
    return t('component.form.input');
  }
  if (component.includes('Picker')) {
    return t('choose');
    return t('component.form.choose');
  }
  if (
    component.includes('Select') ||
@@ -21,7 +21,7 @@
    component.includes('Switch')
  ) {
    // return `请选择${label}`;
    return t('choose');
    return t('component.form.choose');
  }
  return '';
}