Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
T
techbook
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
front-end-dev
techbook
Commits
9eaeea29
Commit
9eaeea29
authored
Aug 22, 2019
by
zhangyanni
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
语言切换
parent
51b129aa
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
17 deletions
+18
-17
PageTop.vue
src/components/index/PageTop.vue
+11
-1
login.vue
src/views/loginregister/pages/login.vue
+7
-16
No files found.
src/components/index/PageTop.vue
View file @
9eaeea29
...
...
@@ -54,7 +54,16 @@
<div
class=
"buttonul"
>
<ul>
<li>
<p><span
class=
"iconfont icon-renzheng"
></span></p>
<p><span>
个人认证
</span></p>
</li>
<li>
<p><span
class=
"iconfont icon-wenhao"
></span></p>
<p><span>
常见问题
</span></p>
</li>
<li>
<p><span
class=
"iconfont icon-bianji"
></span></p>
<p><span>
意见反馈
</span></p>
</li>
</ul>
</div>
...
...
@@ -127,6 +136,7 @@
that
.
$i18n
.
locale
=
that
.
lang
;
//关键语句
window
.
localStorage
.
setItem
(
"language"
,
that
.
lang
);
}
location
.
reload
();
}).
catch
(()
=>
{
});
...
...
src/views/loginregister/pages/login.vue
View file @
9eaeea29
...
...
@@ -37,21 +37,6 @@
this
.
$router
.
push
(
"/"
);
},
changeUrl
(){
if
(
this
.
$route
.
name
==
"mobileLoginCmpt"
)
{
if
(
this
.
$i18n
.
locale
==
"en"
)
this
.
$router
.
push
(
'/emailLoginCmpt'
);
}
if
(
this
.
$route
.
name
==
"emailLoginCmpt"
)
{
if
(
this
.
$i18n
.
locale
==
"zh-CN"
)
this
.
$router
.
push
(
'/mobileLoginCmpt'
);
}
if
(
this
.
$route
.
name
==
"mobileRegisterCmpt"
)
{
if
(
this
.
$i18n
.
locale
==
"en"
)
this
.
$router
.
push
(
'/emailRegisterCmpt'
);
}
if
(
this
.
$route
.
name
==
"emailRegisterCmpt"
){
if
(
this
.
$i18n
.
locale
==
"zh-CN"
)
this
.
$router
.
push
(
'/mobileRegisterCmpt'
);
}
},
//切换语言
changeLangEvent
(
type
)
{
var
that
=
this
;
...
...
@@ -64,12 +49,18 @@
that
.
lang
=
'en'
;
that
.
$i18n
.
locale
=
that
.
lang
;
//关键语句
window
.
localStorage
.
setItem
(
"language"
,
that
.
lang
);
location
.
reload
();
}
else
{
that
.
lang
=
'zh-CN'
;
that
.
$i18n
.
locale
=
that
.
lang
;
//关键语句
window
.
localStorage
.
setItem
(
"language"
,
that
.
lang
);
location
.
reload
();
}
that
.
changeUrl
();
}).
catch
(()
=>
{
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment