Skip to content

Commit

Permalink
fix(ssr): resolve server directives the same as on client (vuejs#9129)
Browse files Browse the repository at this point in the history
  • Loading branch information
ggtmtmgg authored and aJean committed Aug 19, 2020
1 parent bee602b commit 9c8f7bf
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/server/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import { escape } from 'web/server/util'
import { SSR_ATTR } from 'shared/constants'
import { RenderContext } from './render-context'
import { resolveAsset } from 'core/util/options'
import { generateComponentTrace } from 'core/util/debug'
import { ssrCompileToFunctions } from 'web/server/compiler'
import { installSSRHelpers } from './optimizing-compiler/runtime-helpers'
Expand Down Expand Up @@ -324,11 +325,13 @@ function renderStartingTag (node: VNode, context) {
if (dirs) {
for (let i = 0; i < dirs.length; i++) {
const name = dirs[i].name
const dirRenderer = directives[name]
if (dirRenderer && name !== 'show') {
// directives mutate the node's data
// which then gets rendered by modules
dirRenderer(node, dirs[i])
if (name !== 'show') {
const dirRenderer = resolveAsset(context, 'directives', name, true)
if (dirRenderer) {
// directives mutate the node's data
// which then gets rendered by modules
dirRenderer(node, dirs[i])
}
}
}
}
Expand Down

0 comments on commit 9c8f7bf

Please sign in to comment.