code refactor
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
export default function ({i18n}, value, fieldName, translate) {
|
||||
let content = '';
|
||||
|
||||
if (fieldName) {
|
||||
content = value[fieldName];
|
||||
} else {
|
||||
content = value;
|
||||
}
|
||||
|
||||
if (translate) {
|
||||
content = i18n.t(content);
|
||||
}
|
||||
|
||||
return content;
|
||||
}
|
||||
Reference in New Issue
Block a user