chore: add useTranslate

This commit is contained in:
chenjiahan
2020-12-06 16:55:16 +08:00
parent 8875143d1c
commit dea44580df
3 changed files with 16 additions and 4 deletions

View File

@@ -0,0 +1,8 @@
import { getCurrentInstance } from 'vue';
import { noop } from '../utils';
import { createTranslate } from '../utils/create/translate';
export function useTranslate() {
const { name } = getCurrentInstance()!.type;
return name ? createTranslate(name) : noop;
}