From f4ed0459774402151d3916568fcbaf1ffce265d7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=8E=E6=9D=A8?= <1711467488@qq.com>
Date: Tue, 13 Feb 2018 23:57:48 +0800
Subject: [PATCH] no message
Former-commit-id: 90c604cc7feebba050b059445d176423059dcd33
Former-commit-id: 5349eadb83d60d7d840f7c710e624664dbb17b3f
Former-commit-id: c2173544c4a284dc03370b9b2fee6c44caf27776
---
.../plugins/vue-i18n/components/DemoI18n.vue | 36 +++++++++++-------
.../vue-i18n/components/DemoI18nControl.vue | 3 ++
.../plugins/vue-i18n/components/lang.json | 38 +++++++++++++++++++
3 files changed, 63 insertions(+), 14 deletions(-)
create mode 100644 src/pages/demo/plugins/vue-i18n/components/lang.json
diff --git a/src/pages/demo/plugins/vue-i18n/components/DemoI18n.vue b/src/pages/demo/plugins/vue-i18n/components/DemoI18n.vue
index 3e5d6eb0..e5afe05a 100644
--- a/src/pages/demo/plugins/vue-i18n/components/DemoI18n.vue
+++ b/src/pages/demo/plugins/vue-i18n/components/DemoI18n.vue
@@ -1,17 +1,25 @@
-
-{
- "cn": {
- "hello": "你好!"
- },
- "en": {
- "hello": "hello world!"
- },
- "ja": {
- "hello": "こんにちは、世界!"
- }
-}
-
+
- {{$t('hello')}}
+
+
{{$t('hello')}}
+
{{$t('vue')}}
+
{{$t('check.title')}}
+
+ {{$t('check.label.Beijing')}}
+ {{$t('check.label.Tokyo')}}
+ {{$t('check.label.NewYork')}}
+
+
+
+
+
diff --git a/src/pages/demo/plugins/vue-i18n/components/DemoI18nControl.vue b/src/pages/demo/plugins/vue-i18n/components/DemoI18nControl.vue
index 9f1f756a..b9ce9eab 100644
--- a/src/pages/demo/plugins/vue-i18n/components/DemoI18nControl.vue
+++ b/src/pages/demo/plugins/vue-i18n/components/DemoI18nControl.vue
@@ -15,6 +15,9 @@ export default {
lang: 'cn'
}
},
+ created () {
+ this.lang = this.$i18n.locale
+ },
methods: {
handleChange (val) {
this.$i18n.locale = val
diff --git a/src/pages/demo/plugins/vue-i18n/components/lang.json b/src/pages/demo/plugins/vue-i18n/components/lang.json
new file mode 100644
index 00000000..d7b444d6
--- /dev/null
+++ b/src/pages/demo/plugins/vue-i18n/components/lang.json
@@ -0,0 +1,38 @@
+{
+ "cn": {
+ "hello": "你好",
+ "vue": "Vue (读音 /vjuː/,类似于 view) 是一套用于构建用户界面的渐进式框架。与其它大型框架不同的是,Vue 被设计为可以自底向上逐层应用。Vue 的核心库只关注视图层,不仅易于上手,还便于与第三方库或既有项目整合。另一方面,当与现代化的工具链以及各种支持类库结合使用时,Vue 也完全能够为复杂的单页应用提供驱动。",
+ "check": {
+ "title": "请选择",
+ "label": {
+ "Beijing": "北京",
+ "Tokyo": "东京",
+ "NewYork": "纽约"
+ }
+ }
+ },
+ "en": {
+ "hello": "hello",
+ "vue": "Vue (pronounced /vjuː/, like view) is a progressive framework for building user interfaces. Unlike other monolithic frameworks, Vue is designed from the ground up to be incrementally adoptable. The core library is focused on the view layer only, and is easy to pick up and integrate with other libraries or existing projects. On the other hand, Vue is also perfectly capable of powering sophisticated Single-Page Applications when used in combination with modern tooling and supporting libraries.",
+ "check": {
+ "title": "Please choose",
+ "label": {
+ "Beijing": "Beijing",
+ "Tokyo": "Tokyo",
+ "NewYork": "NewYork"
+ }
+ }
+ },
+ "ja": {
+ "hello": "こんにちは",
+ "vue": "Vue (発音は /vjuː/、view と同様)はユーザーインターフェイスを構築するためのプログレッシブフレームワークです。他の一枚板(モノリシック: monolithic)なフレームワークとは異なり、Vue は少しずつ適用していけるように設計されています。中核となるライブラリは view 層だけに焦点を当てています。そのため、使い始めるのも、他のライブラリや既存のプロジェクトに統合するのも、とても簡単です。また、モダンなツールやサポートライブラリと併用することで、洗練されたシングルページアプリケーションの開発も可能です。",
+ "check": {
+ "title": "選択してください",
+ "label": {
+ "Beijing": "北京",
+ "Tokyo": "東京",
+ "NewYork": "ニューヨーク"
+ }
+ }
+ }
+}
\ No newline at end of file