vue 后台翻译_1kb 简单但强大的 Vue 翻译插件,支持服务端渲染

Vue Translator 是一个简单的 Vue 翻译插件,适用于服务器端渲染。它提供了一种在组件中定义翻译的方法,并且在开发环境下会警告重复的翻译键。支持基本使用、监听语言变化、处理不存在的键以及服务器端渲染相关的配置。
摘要由CSDN通过智能技术生成

A deadly simple i18n translate plugin for Vue, ready for Server Side Rendering.

Demo

Usage

yarn add vue-translator复制代码

Basic Usage

import Vue from 'vue'

import VueTranslator form 'vue-translator'

Vue.use(VueTranslator, {

locale?: string, // set it on initialize or before first rendering

translations?: { // If you want to define translations in component only, no need to set it on initialize

[locale: string]: {

[key:string]: string | array | object

}

},

defaultLocale?: string, // when no value can be found in current locale, try to fallback to defaultLocale

merge?: Function // `lodash.merge` for example, if you

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值