Ben Lin
2024-05-01 4a1a5b96689ce49cba56f7b668d73ed5edc7ff2c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import { ComponentType } from './componentType';
import { useI18n } from '/@/hooks/web/useI18n';
 
const { t } = useI18n();
 
/**
 * @description: 生成placeholder
 */
export function createPlaceholderMessage(component: ComponentType) {
  if (!component) return;
  if (component.includes('RangePicker')) {
    return [t('common.chooseText'), t('common.chooseText')];
  }
  if (component.includes('Input') || component.includes('Complete') || component.includes('Rate')) {
    return t('common.inputText');
  } else {
    return t('common.chooseText');
  }
}