Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
node-sample
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
周韬
node-sample
Commits
bd1f91b6
Commit
bd1f91b6
authored
Aug 11, 2016
by
Evan You
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tweak comments
parent
e7014499
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
1 deletion
+2
-1
Item.vue
src/components/Item.vue
+1
-0
server-entry.js
src/server-entry.js
+1
-1
No files found.
src/components/Item.vue
View file @
bd1f91b6
...
@@ -30,6 +30,7 @@
...
@@ -30,6 +30,7 @@
export
default
{
export
default
{
name
:
'news-item'
,
name
:
'news-item'
,
props
:
[
'item'
],
props
:
[
'item'
],
// https://github.com/vuejs/vue/blob/next/packages/vue-server-renderer/README.md#component-caching
serverCacheKey
:
props
=>
{
serverCacheKey
:
props
=>
{
return
`
${
props
.
item
.
id
}
::
${
props
.
item
.
__lastUpdated
}
`
return
`
${
props
.
item
.
id
}
::
${
props
.
item
.
__lastUpdated
}
`
}
}
...
...
src/server-entry.js
View file @
bd1f91b6
...
@@ -24,7 +24,7 @@ export default context => {
...
@@ -24,7 +24,7 @@ export default context => {
})).
then
(()
=>
{
})).
then
(()
=>
{
isDev
&&
console
.
log
(
`data pre-fetch:
${
Date
.
now
()
-
s
}
ms`
)
isDev
&&
console
.
log
(
`data pre-fetch:
${
Date
.
now
()
-
s
}
ms`
)
// After all preFetch hooks are resolved, our store is now
// After all preFetch hooks are resolved, our store is now
// filled with the
needed state
to render the app.
// filled with the
state needed
to render the app.
// Expose the state on the render context, and let the request handler
// Expose the state on the render context, and let the request handler
// inline the state in the HTML response. This allows the client-side
// inline the state in the HTML response. This allows the client-side
// store to pick-up the server-side state without having to duplicate
// store to pick-up the server-side state without having to duplicate
...
...
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