Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf9cca1d

Browse files
committed
Moved translations to component
1 parentbac0b57 commitf9cca1d

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

‎src/components/TinyPagination.vue

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
</template>
2424

2525
<script>
26-
import {Language,AvailableLanguages}from'../utils'
2726
exportdefault {
2827
name:'TinyPagination',
2928
props: {
@@ -52,17 +51,30 @@ export default {
5251
data () {
5352
return {
5453
currentPage:1,
55-
currentLimit:10
54+
currentLimit:10,
55+
translations: {
56+
en: {
57+
prev:'Previous',
58+
title:'Page',
59+
next:'Next'
60+
},
61+
es: {
62+
prev:'Anterior',
63+
title:'Página',
64+
next:'Siguiente'
65+
}
66+
},
67+
availableLanguages: ['en','es']
5668
}
5769
},
5870
created () {
5971
this.currentPage=this.page
6072
},
6173
computed: {
6274
translation () {
63-
return (AvailableLanguages.includes(this.lang))?
64-
Language.translations[this.lang]
65-
:Language.translations['en']
75+
return (this.availableLanguages.includes(this.lang))?
76+
this.translations[this.lang]
77+
:this.translations['en']
6678
},
6779
totalPages () {
6880
returnMath.ceil(this.total/this.currentLimit)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp