UNPKG

vue-fantable

Version:
19 lines (18 loc) 557 B
import { shallowRef, triggerRef } from 'vue' import { cloneDeep } from '@P/src/utils/index' import LangEN from '@P/src/locale/lang/en-US' const defaultLang = shallowRef(cloneDeep(LangEN)) export const useLocal = (local) => { console.log('🚀 ~ useLocal ~ local:', local) triggerRef(defaultLang) if (local.pagination) { defaultLang.value.pagination = local.pagination } if (local.table) { defaultLang.value.table = local.table } return defaultLang.value } export const getLocal = () => { return defaultLang.value }