Skip to content

Commit

Permalink
feat(ssr): allow opting-out of caching by returning false in serverCa…
Browse files Browse the repository at this point in the history
…cheKey

close #8790
  • Loading branch information
yyx990803 committed Dec 20, 2018
1 parent d7a533d commit ab24285
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/server/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,12 @@ function renderComponent (node, isRoot, context) {
const registerComponent = registerComponentForCache(Ctor.options, write)

if (isDef(getKey) && isDef(cache) && isDef(name)) {
const key = name + '::' + getKey(node.componentOptions.propsData)
const rawKey = getKey(node.componentOptions.propsData)
if (rawKey === false) {
renderComponentInner(node, isRoot, context)
return
}
const key = name + '::' + rawKey
const { has, get } = context
if (isDef(has)) {
has(key, hit => {
Expand Down Expand Up @@ -188,7 +193,7 @@ function renderComponentInner (node, isRoot, context) {
context.activeInstance
)
normalizeRender(child)

const resolve = () => {
const childNode = child._render()
childNode.parent = node
Expand Down

0 comments on commit ab24285

Please sign in to comment.