Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pj-vueTest-project
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
yeahzzzz
pj-vueTest-project
Commits
385b1e54
Commit
385b1e54
authored
Mar 08, 2019
by
yeahzzzz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Delete spa_index.html
parent
be27fe6a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
108 deletions
+0
-108
spa_index.html
spa_index.html
+0
-108
No files found.
spa_index.html
deleted
100644 → 0
View file @
be27fe6a
<!DOCTYPE html>
<html
lang=
"en"
dir=
"ltr"
>
<head>
<meta
charset=
"utf-8"
>
<title>
test
</title>
<script
type=
"text/javascript"
src=
'js/jquery-3.3.1.js'
></script>
<link
rel=
"stylesheet"
href=
"css\spa_index.css"
>
</head>
<script
type=
"text/javascript"
>
let
router
=
[
{
name
:
"
index
"
,
path
:
"
/index
"
,
title
:
"
首页
"
,
isActive
:
"
false
"
,
},
{
name
:
"
news
"
,
path
:
"
/news
"
,
title
:
"
新闻
"
,
isActive
:
"
true
"
,
},
{
name
:
"
about
"
,
path
:
"
/about
"
,
title
:
"
介绍
"
,
isActive
:
"
false
"
,
},
]
function
createHtmlPages
()
{
changePage
(
'
index
'
)
}
function
changePage
(
pageName
)
{
let
index
=
-
1
let
indexActive
=-
1
for
(
var
i
=
0
;
i
<
router
.
length
;
i
++
)
{
if
(
router
[
i
].
name
==
pageName
)
{
index
=
i
;
}
if
(
router
[
i
].
isActive
)
{
indexActive
=
i
;
}
}
if
(
index
!=-
1
&&
index
!=
indexActive
)
{
router
[
index
].
isActive
=
true
;
router
[
indexActive
].
isActive
=
false
console
.
log
(
"
changed to
"
+
pageName
);
}
else
{
console
.
log
(
"
page not found
"
);
}
refreshHtml
()
}
function
refreshHtml
()
{
let
htmlContent
=
'
'
;
for
(
let
i
=
0
;
i
<
router
.
length
;
i
++
)
{
let
addClass
=
'
'
if
(
router
[
i
].
isActive
)
{
addClass
=
'
'
}
else
{
addClass
=
'
hide
'
;
}
htmlContent
=
htmlContent
+
"
<div class='page page-bgcolor-blue
"
+
addClass
+
"
' routeName='page-
"
+
router
[
i
].
name
+
"
'>
"
+
router
[
i
].
title
+
"
</div>
"
}
console
.
log
(
htmlContent
)
$
(
"
#layout-1
"
).
html
(
htmlContent
)
}
</script>
<body>
<div
id=
"layout-1 "
>
</div>
<!-- <div class="page page-bgcolor-blue" id="page-1">
<div>
<span onclick='changePage("page-1")'>首页</span>
<span onclick='changePage("page-2")'>新闻</span>
<span onclick='changePage("page-3")'>介绍</span>
</div>
<h1>首页</h1>
</div>
<div class="page page-bgcolor-blue" id="page-2">
<div>
<span onclick='changePage("page-1")'>首页</span>
<span onclick='changePage("page-2")'>新闻</span>
<span onclick='changePage("page-3")'>介绍</span>
</div>
<h1>新闻</h1>
</div>
<div class="page page-bgcolor-blue" id="page-3">
<div>
<span onclick='changePage("page-1")'>首页</span>
<span onclick='changePage("page-2")'>新闻</span>
<span onclick='changePage("page-3")'>介绍</span>
</div>
<h1>介绍</h1>
</div> -->
</body>
</html>
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