File tree Expand file tree Collapse file tree 4 files changed +11
-11
lines changed Expand file tree Collapse file tree 4 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -5,11 +5,11 @@ import locale from './locale/index';
5
5
export default {
6
6
install ( Vue , options = { } ) {
7
7
Vue . component ( 'vue-loadmore' , VueLoadmore ) ;
8
-
8
+
9
9
locale . use ( options . lang ) ;
10
10
}
11
11
} ;
12
12
13
13
export {
14
14
locale
15
- }
15
+ } ;
Original file line number Diff line number Diff line change @@ -5,27 +5,27 @@ import enUS from './lang/en-US';
5
5
6
6
const langLibrary = {
7
7
'zh-CN' : zhCN ,
8
- 'en-US' : enUS ,
8
+ 'en-US' : enUS
9
9
} ;
10
10
11
11
const proto = Vue . prototype ;
12
12
const { defineReactive } = Vue . util ;
13
13
// 将proto.lang定义成响应式数据
14
14
defineReactive ( proto , 'lang' , 'zh-CN' ) ;
15
15
16
- const getLangLibrary = ( ) => langLibrary [ proto . lang ] ;
16
+ const getLangLibrary = ( ) => langLibrary [ proto . lang ] ;
17
17
18
18
export default {
19
19
// 获取当前语言库的值
20
- t ( path ) {
20
+ t ( path ) {
21
21
const library = getLangLibrary ( ) ;
22
22
return getDeepVal ( library , path ) ;
23
23
} ,
24
24
25
25
// 使用某个语言库(zhCN/enUS)
26
- use ( lang ) {
26
+ use ( lang ) {
27
27
if ( langLibrary [ lang ] ) {
28
28
proto . lang = lang ;
29
29
}
30
30
}
31
- } ;
31
+ } ;
Original file line number Diff line number Diff line change @@ -9,5 +9,5 @@ export default {
9
9
loading : 'Loading' ,
10
10
finished : 'No more data' ,
11
11
error : 'Request failed, click to reload'
12
- } ,
13
- }
12
+ }
13
+ } ;
Original file line number Diff line number Diff line change @@ -9,5 +9,5 @@ export default {
9
9
loading : '正在加载' ,
10
10
finished : '没有更多了' ,
11
11
error : '请求失败,点击重新加载'
12
- } ,
13
- }
12
+ }
13
+ } ;
You can’t perform that action at this time.
0 commit comments