mirror of
https://github.com/youzan/vant.git
synced 2025-10-18 09:24:25 +00:00
chore: add useTranslate
This commit is contained in:
8
src/composables/use-translate.ts
Normal file
8
src/composables/use-translate.ts
Normal 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;
|
||||
}
|
Reference in New Issue
Block a user