no message

Former-commit-id: b10907f05b3edf4f989f88aeb3dfd791e6193f68
Former-commit-id: 2c3cd9fbb8dd48e806059f68f7bf572d54f7ea5a
Former-commit-id: 19fa12c189c6e7e91583a9ffdcaa5c01cfd60170
This commit is contained in:
李杨
2018-02-13 21:33:44 +08:00
parent da5c65033f
commit 0b934aeb42
4 changed files with 43 additions and 36 deletions

View File

@@ -0,0 +1,3 @@
<template>
<el-button>{{$t('message.hello')}}</el-button>
</template>

View File

@@ -0,0 +1,24 @@
<template>
<div class="dd-mb">
<el-radio-group v-model="lang" @change="handleChange">
<el-radio-button label="CN">中文</el-radio-button>
<el-radio-button label="EN">English</el-radio-button>
</el-radio-group>
</div>
</template>
<script>
export default {
data () {
return {
lang: 'CN'
}
},
methods: {
handleChange (val) {
this.$i18n.locale = val
}
}
}
</script>

View File

@@ -2,31 +2,21 @@
<Container> <Container>
<PageHeader <PageHeader
slot="header" slot="header"
title="示例1" title="示例 1"
url="http://kazupon.github.io/vue-i18n/en/"> url="http://kazupon.github.io/vue-i18n/en/">
</PageHeader> </PageHeader>
<div class="dd-mb"> <DemoI18nControl></DemoI18nControl>
<el-radio-group v-model="lang" @change="handleChange"> <DemoI18n></DemoI18n>
<el-radio-button label="CN">中文</el-radio-button>
<el-radio-button label="EN">English</el-radio-button>
</el-radio-group>
</div>
<el-button>{{$t('message.hello')}}</el-button>
</Container> </Container>
</template> </template>
<script> <script>
import DemoI18nControl from './components/DemoI18nControl'
import DemoI18n from './components/DemoI18n'
export default { export default {
data () { components: {
return { DemoI18nControl,
lang: 'CN' DemoI18n
}
},
methods: {
handleChange (val) {
this.$i18n.locale = val
}
} }
} }
</script> </script>

View File

@@ -2,31 +2,21 @@
<Container> <Container>
<PageHeader <PageHeader
slot="header" slot="header"
title="示例2" title="示例 2"
url="http://kazupon.github.io/vue-i18n/en/"> url="http://kazupon.github.io/vue-i18n/en/">
</PageHeader> </PageHeader>
<div class="dd-mb"> <DemoI18nControl></DemoI18nControl>
<el-radio-group v-model="lang" @change="handleChange"> <DemoI18n></DemoI18n>
<el-radio-button label="CN">中文</el-radio-button>
<el-radio-button label="EN">English</el-radio-button>
</el-radio-group>
</div>
<p>{{$t('message.hello')}}</p>
</Container> </Container>
</template> </template>
<script> <script>
import DemoI18nControl from './components/DemoI18nControl'
import DemoI18n from './components/DemoI18n'
export default { export default {
data () { components: {
return { DemoI18nControl,
lang: 'CN' DemoI18n
}
},
methods: {
handleChange (val) {
this.$i18n.locale = val
}
} }
} }
</script> </script>