Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vue-ssr
Project
Project
Details
Activity
Releases
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
lixy
vue-ssr
Commits
fb38dfe0
Commit
fb38dfe0
authored
Aug 27, 2019
by
lixy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
page
parent
147a9111
Pipeline
#57
canceled with stages
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
99 additions
and
0 deletions
+99
-0
README.md
pages/README.md
+7
-0
index.vue
pages/index.vue
+51
-0
users.vue
pages/users.vue
+41
-0
No files found.
pages/README.md
0 → 100644
View file @
fb38dfe0
# PAGES
This directory contains your Application Views and Routes.
The framework reads all the .vue files inside this directory and creates the router of your application.
More information about the usage of this directory in the documentation:
https://nuxtjs.org/guide/routing
pages/index.vue
0 → 100644
View file @
fb38dfe0
<
template
>
<div
class=
"container"
>
<h2>
新闻列表
</h2>
<ul
class=
"users"
>
<li
v-for=
"user in users"
:key=
"user.id"
>
<nuxt-link
to=
"/users"
>
{{
user
.
title
}}
</nuxt-link>
<div
v-html=
"user.value"
></div>
</li>
</ul>
</div>
</
template
>
<
script
>
import
axios
from
'axios'
export
default
{
transition
:
'bounce'
,
async
asyncData
()
{
const
{
data
}
=
await
axios
.
get
(
'https://xxtest.upyuns.com/api/app/cofig/app/unauth/types?types=1'
);
let
cc
=
data
.
data
;
return
{
users
:
cc
}
},
}
</
script
>
<
style
scoped
>
.container
{
text-align
:
center
;
/* margin-top: 100px; */
font-family
:
sans-serif
;
}
/* li{
text-decoration: none;
} */
.users
{
list-style-type
:
none
;
}
.users
li
a
{
display
:
inline-block
;
/* border: 1px #ddd solid; */
padding
:
10px
;
text-align
:
left
;
color
:
#222
;
text-decoration
:
none
;
}
.users
li
a
:hover
{
color
:
orange
;
}
</
style
>
pages/users.vue
0 → 100644
View file @
fb38dfe0
<
template
>
<div
class=
"wrap"
>
<p>
这里是详情页
</p>
{{
users
}}
<nuxt-link
to=
"/"
>
返回首页
</nuxt-link>
</div>
</
template
>
<
script
>
import
axios
from
'axios'
export
default
{
transition
:
'bounce'
,
async
asyncData
()
{
const
{
data
}
=
await
axios
.
get
(
'https://xxtest.upyuns.com/api/app/cofig/app/unauth/types?types=1'
);
let
cc
=
data
.
data
;
return
{
users
:
cc
}
},
// asyncData() {
// return new Promise((resolve) => {
// setTimeout(function () {
// resolve({})
// }, 0)
// })
//
// },
head
:
{
title
:
'详情页'
}
}
</
script
>
<
style
scoped
>
.wrap
{
width
:
100%
;
height
:
100%
;
display
:
flex
;
flex-direction
:
column
;
align-items
:
center
;
justify-content
:
center
;
margin-top
:
200px
}
</
style
>
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