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';
55export default {
66 install ( Vue , options = { } ) {
77 Vue . component ( 'vue-loadmore' , VueLoadmore ) ;
8-
8+
99 locale . use ( options . lang ) ;
1010 }
1111} ;
1212
1313export {
1414 locale
15- }
15+ } ;
Original file line number Diff line number Diff line change @@ -5,27 +5,27 @@ import enUS from './lang/en-US';
55
66const langLibrary = {
77 'zh-CN' : zhCN ,
8- 'en-US' : enUS ,
8+ 'en-US' : enUS
99} ;
1010
1111const proto = Vue . prototype ;
1212const { defineReactive } = Vue . util ;
1313// 将proto.lang定义成响应式数据
1414defineReactive ( proto , 'lang' , 'zh-CN' ) ;
1515
16- const getLangLibrary = ( ) => langLibrary [ proto . lang ] ;
16+ const getLangLibrary = ( ) => langLibrary [ proto . lang ] ;
1717
1818export default {
1919 // 获取当前语言库的值
20- t ( path ) {
20+ t ( path ) {
2121 const library = getLangLibrary ( ) ;
2222 return getDeepVal ( library , path ) ;
2323 } ,
2424
2525 // 使用某个语言库(zhCN/enUS)
26- use ( lang ) {
26+ use ( lang ) {
2727 if ( langLibrary [ lang ] ) {
2828 proto . lang = lang ;
2929 }
3030 }
31- } ;
31+ } ;
Original file line number Diff line number Diff line change @@ -9,5 +9,5 @@ export default {
99 loading : 'Loading' ,
1010 finished : 'No more data' ,
1111 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 {
99 loading : '正在加载' ,
1010 finished : '没有更多了' ,
1111 error : '请求失败,点击重新加载'
12- } ,
13- }
12+ }
13+ } ;
You can’t perform that action at this time.
0 commit comments