diff --git a/src/platforms/web/server/directives/show.js b/src/platforms/web/server/directives/show.js index 5473fb2bd4d..7493b27e087 100644 --- a/src/platforms/web/server/directives/show.js +++ b/src/platforms/web/server/directives/show.js @@ -3,6 +3,10 @@ export default function show (node: VNodeWithData, dir: VNodeDirective) { if (!dir.value) { const style: any = node.data.style || (node.data.style = {}) - style.display = 'none' + if (Array.isArray(style)) { + style.push({ display: 'none' }) + } else { + style.display = 'none' + } } } diff --git a/test/ssr/ssr-string.spec.js b/test/ssr/ssr-string.spec.js index 4d3ace46019..5300bbfefa5 100644 --- a/test/ssr/ssr-string.spec.js +++ b/test/ssr/ssr-string.spec.js @@ -267,6 +267,17 @@ describe('SSR: renderToString', () => { }) }) + it('v-show directive merge with style', done => { + renderVmWithOptions({ + template: '