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
759eedd5
Commit
759eedd5
authored
Aug 28, 2019
by
lixy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
demo
parent
a8a8bd58
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
187 additions
and
9 deletions
+187
-9
App.js
.nuxt/App.js
+2
-0
router.js
.nuxt/router.js
+26
-8
utils.js
.nuxt/utils.js
+1
-1
nuxt.config.js
nuxt.config.js
+7
-0
demo.vue
pages/demo.vue
+86
-0
_id.vue
pages/demoList/_id.vue
+46
-0
demoList.vue
pages/demoList/demoList.vue
+19
-0
No files found.
.nuxt/App.js
View file @
759eedd5
...
@@ -3,6 +3,8 @@ import NuxtLoading from '~/components/loading.vue'
...
@@ -3,6 +3,8 @@ import NuxtLoading from '~/components/loading.vue'
import
'..
\\
assets
\\
main.css'
import
'..
\\
assets
\\
main.css'
import
'..
\\
node_modules
\\
_swiper@4.0.7@swiper
\\
dist
\\
css
\\
swiper.min.css'
let
layouts
=
{
let
layouts
=
{
...
...
.nuxt/router.js
View file @
759eedd5
...
@@ -5,10 +5,13 @@ Vue.use(Router)
...
@@ -5,10 +5,13 @@ Vue.use(Router)
const
_916d4edc
=
()
=>
import
(
'..
\\
pages
\\
vehicle.vue'
/* webpackChunkName: "pages_vehicle" */
).
then
(
m
=>
m
.
default
||
m
)
const
_916d4edc
=
()
=>
import
(
'..
\\
pages
\\
vehicle.vue'
/* webpackChunkName: "pages_vehicle" */
).
then
(
m
=>
m
.
default
||
m
)
const
_55fc1c46
=
()
=>
import
(
'..
\\
pages
\\
news.vue'
/* webpackChunkName: "pages_news" */
).
then
(
m
=>
m
.
default
||
m
)
const
_55fc1c46
=
()
=>
import
(
'..
\\
pages
\\
news.vue'
/* webpackChunkName: "pages_news" */
).
then
(
m
=>
m
.
default
||
m
)
const
_1b4d0cd2
=
()
=>
import
(
'..
\\
pages
\\
campsite.vue'
/* webpackChunkName: "pages_campsite" */
).
then
(
m
=>
m
.
default
||
m
)
const
_96254626
=
()
=>
import
(
'..
\\
pages
\\
demo.vue'
/* webpackChunkName: "pages_demo" */
).
then
(
m
=>
m
.
default
||
m
)
const
_1b677f5a
=
()
=>
import
(
'..
\\
pages
\\
aboutXx.vue'
/* webpackChunkName: "pages_aboutXx" */
).
then
(
m
=>
m
.
default
||
m
)
const
_0e939319
=
()
=>
import
(
'..
\\
pages
\\
activity.vue'
/* webpackChunkName: "pages_activity" */
).
then
(
m
=>
m
.
default
||
m
)
const
_0e939319
=
()
=>
import
(
'..
\\
pages
\\
activity.vue'
/* webpackChunkName: "pages_activity" */
).
then
(
m
=>
m
.
default
||
m
)
const
_1b677f5a
=
()
=>
import
(
'..
\\
pages
\\
aboutXx.vue'
/* webpackChunkName: "pages_aboutXx" */
).
then
(
m
=>
m
.
default
||
m
)
const
_1b4d0cd2
=
()
=>
import
(
'..
\\
pages
\\
campsite.vue'
/* webpackChunkName: "pages_campsite" */
).
then
(
m
=>
m
.
default
||
m
)
const
_51cf86e2
=
()
=>
import
(
'..
\\
pages
\\
tour.vue'
/* webpackChunkName: "pages_tour" */
).
then
(
m
=>
m
.
default
||
m
)
const
_51cf86e2
=
()
=>
import
(
'..
\\
pages
\\
tour.vue'
/* webpackChunkName: "pages_tour" */
).
then
(
m
=>
m
.
default
||
m
)
const
_5df21ee8
=
()
=>
import
(
'..
\\
pages
\\
demoList
\\
demoList.vue'
/* webpackChunkName: "pages_demoList_demoList" */
).
then
(
m
=>
m
.
default
||
m
)
const
_802b9bc2
=
()
=>
import
(
'..
\\
pages
\\
demoList
\\
_id.vue'
/* webpackChunkName: "pages_demoList__id" */
).
then
(
m
=>
m
.
default
||
m
)
const
_e86eea90
=
()
=>
import
(
'..
\\
pages
\\
index.vue'
/* webpackChunkName: "pages_index" */
).
then
(
m
=>
m
.
default
||
m
)
const
_e86eea90
=
()
=>
import
(
'..
\\
pages
\\
index.vue'
/* webpackChunkName: "pages_index" */
).
then
(
m
=>
m
.
default
||
m
)
...
@@ -80,9 +83,14 @@ export function createRouter () {
...
@@ -80,9 +83,14 @@ export function createRouter () {
name
:
"news"
name
:
"news"
},
},
{
{
path
:
"/campsite"
,
path
:
"/demo"
,
component
:
_1b4d0cd2
,
component
:
_96254626
,
name
:
"campsite"
name
:
"demo"
},
{
path
:
"/activity"
,
component
:
_0e939319
,
name
:
"activity"
},
},
{
{
path
:
"/aboutXx"
,
path
:
"/aboutXx"
,
...
@@ -90,15 +98,25 @@ export function createRouter () {
...
@@ -90,15 +98,25 @@ export function createRouter () {
name
:
"aboutXx"
name
:
"aboutXx"
},
},
{
{
path
:
"/
activity
"
,
path
:
"/
campsite
"
,
component
:
_
0e939319
,
component
:
_
1b4d0cd2
,
name
:
"
activity
"
name
:
"
campsite
"
},
},
{
{
path
:
"/tour"
,
path
:
"/tour"
,
component
:
_51cf86e2
,
component
:
_51cf86e2
,
name
:
"tour"
name
:
"tour"
},
},
{
path
:
"/demoList/demoList"
,
component
:
_5df21ee8
,
name
:
"demoList-demoList"
},
{
path
:
"/demoList/:id?"
,
component
:
_802b9bc2
,
name
:
"demoList-id"
},
{
{
path
:
"/"
,
path
:
"/"
,
component
:
_e86eea90
,
component
:
_e86eea90
,
...
...
.nuxt/utils.js
View file @
759eedd5
...
@@ -120,7 +120,7 @@ export async function setContext(app, context) {
...
@@ -120,7 +120,7 @@ export async function setContext(app, context) {
payload
:
context
.
payload
,
payload
:
context
.
payload
,
error
:
context
.
error
,
error
:
context
.
error
,
base
:
'/'
,
base
:
'/'
,
env
:
{}
env
:
{
"host"
:
"https://dev.dfangche.com"
}
}
}
// Only set once
// Only set once
if
(
context
.
req
)
app
.
context
.
req
=
context
.
req
if
(
context
.
req
)
app
.
context
.
req
=
context
.
req
...
...
nuxt.config.js
View file @
759eedd5
...
@@ -45,5 +45,12 @@ module.exports = {
...
@@ -45,5 +45,12 @@ module.exports = {
return
[
'script'
,
'style'
,
'font'
].
includes
(
type
)
return
[
'script'
,
'style'
,
'font'
].
includes
(
type
)
}
}
}
}
},
env
:
{
host
:
"https://dev.dfangche.com"
},
generate
:
{
routes
:
[
]
}
}
}
}
pages/demo.vue
0 → 100644
View file @
759eedd5
<
template
>
<div
class=
"container"
>
<div
class=
"left"
>
<h2>
<nuxt-link
to=
"/demo"
>
Players
</nuxt-link>
</h2>
<ul
class=
"players"
>
<li
v-for=
"user in users"
:key=
"user.id"
>
<nuxt-link
:to=
"'/demoList/'+user.id"
>
{{
user
.
name
}}
</nuxt-link>
</li>
</ul>
</div>
<div
class=
"right"
>
<nuxt-child
:key=
"$route.params.id"
/>
</div>
</div>
</
template
>
<
script
>
import
axios
from
'axios'
export
default
{
async
asyncData
({
env
})
{
const
{
data
}
=
await
axios
.
get
(
env
.
host
+
'/api/uccn/app/unauth/campsite/shops?type=53&pageNo=1&pageSize=10'
);
let
cc
=
data
.
data
.
data
;
console
.
log
(
data
);
// return { users: env.users }
return
{
users
:
cc
}
},
// asyncData ({ env }) {
// return { users: env.users }
// }
}
</
script
>
<
style
scoped
>
.page-enter-active
,
.page-leave-active
{
transition
:
opacity
.4s
,
transform
.4s
;
transform-style
:
preserve-3d
;
backface-visibility
:
hidden
;
opacity
:
1
;
}
.page-enter
,
.page-leave-active
{
opacity
:
0.5
;
transform
:
rotateY
(
100deg
);
}
.container
{
width
:
100%
;
margin
:
0
;
padding
:
0
;
font-family
:
sans-serif
;
box-sizing
:
border-box
;
}
.left
{
width
:
50%
;
position
:
absolute
;
top
:
0
;
left
:
0
;
}
.right
{
width
:
50%
;
position
:
absolute
;
top
:
0
;
right
:
0
;
}
.players
{
list-style-type
:
none
;
margin
:
0
;
padding
:
0
;
}
.players
li
a
{
display
:
block
;
border
:
1px
#ddd
solid
;
padding
:
10px
;
text-align
:
left
;
color
:
#222
;
text-decoration
:
none
;
}
.players
li
a
:hover
{
color
:
orange
;
}
</
style
>
pages/demoList/_id.vue
0 → 100644
View file @
759eedd5
<
template
>
<div
class=
"player"
>
<h1>
{{
name
}}
</h1>
<h2>
{{
name
}}
</h2>
</div>
</
template
>
<
script
>
import
axios
from
'axios'
export
default
{
validate
({
params
})
{
console
.
log
(
params
.
id
);
return
!
isNaN
(
+
params
.
id
)
},
async
asyncData
({
env
,
params
,
error
})
{
const
{
data
}
=
await
axios
.
get
(
env
.
host
+
'/api/uccn/app/unauth/campsite/shop?id='
+
params
.
id
);
let
user
=
data
.
data
;
if
(
!
user
)
{
return
error
({
message
:
'User not found'
,
statusCode
:
404
})
}
return
user
},
// asyncData ({ params, env, error }) {
////
// const user = env.users.find(user => String(user.id) === params.id)
// if (!user) {
// return error({ message: 'User not found', statusCode: 404 })
// }
// return user
// },
head
()
{
return
{
title
:
this
.
name
}
}
}
</
script
>
<
style
scoped
>
.player
{
text-align
:
center
;
margin-top
:
100px
;
font-family
:
sans-serif
;
}
</
style
>
pages/demoList/demoList.vue
0 → 100644
View file @
759eedd5
<
template
>
<h2>
Please select an user.
</h2>
</
template
>
<
script
>
export
default
{
head
:
{
title
:
'Please select an user'
}
}
</
script
>
<
style
scoped
>
h2
{
text-align
:
center
;
margin-top
:
100px
;
font-family
:
sans-serif
;
}
</
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