diff --git a/src/utils/ceobeCanteen.js b/src/utils/ceobeCanteen.js index 206b98c1..8edcddd8 100644 --- a/src/utils/ceobeCanteen.js +++ b/src/utils/ceobeCanteen.js @@ -3,8 +3,11 @@ import { computed, inject } from 'vue'; export const useCeobeApiUtils = () => { const isLocaleZH = computed(() => inject('getRoot')?.()?.$root.localeZH); + /** + * @returns {string} + */ const getLocalizedText = obj => - obj[isLocaleZH.value ? 'zh_CN' : 'en_US'] || obj.zh_CN || obj.en_US || ''; + obj[isLocaleZH.value ? 'zh_CN' : 'en_US'] ?? obj.zh_CN ?? obj.en_US ?? ''; return { isLocaleZH,