evo-mark/inertia-i18n
最新稳定版本:v1.2.0
Composer 安装命令:
composer require evo-mark/inertia-i18n
包简介
Internationalisation support for Inertia projects
关键字:
README 文档
README
Inertia I18n
Installation
composer require evo-mark/inertia-i18n
npm install ./vendor/evo-mark/inertia-i18n -- pnpm add ./vendor/evo-mark/inertia-i18n
import InertiaI18n from "inertia-i18n/vite"; export default { plugins: [InertiaI18n()], };
import useInertiaI18nVue from "inertia-i18n/vue"; createInertiaApp({ setup({ el, App, props, plugin }) { const inertiaI18nPlugin = useInertiaI18nVue(props); // Optional, but you may get warnings without this await inertiaI18nPlugin.load(); createSSRApp({ render: () => h(App, props) }) .use(plugin) .use(inertiaI18nPlugin) .mount(el); }, });
Usage
After installation, you can use your frontend localisation package as usual:
<template> <div>{{ $t('messages.hello_world') }}</div> </template>
OR
<script setup> import { useI18n } from 'vue-i18n'; const { t } = useI18n(); const translated = computed(() => t('message.hello_world)); </script>
See the documentation for the respective frontend packages for more information:
Vue: vue-i18n
统计信息
- 总下载量: 911
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 3
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-01-06