|
|
@@ -11,9 +11,9 @@ describe('ssr: v-show', () => {
|
|
|
const { ssrRenderAttrs: _ssrRenderAttrs } = require("vue/server-renderer")
|
|
|
|
|
|
return function ssrRender(_ctx, _push, _parent, _attrs) {
|
|
|
- _push(\`<div\${_ssrRenderAttrs(_mergeProps({
|
|
|
+ _push(\`<div\${_ssrRenderAttrs(_mergeProps(_attrs, {
|
|
|
style: (_ctx.foo) ? null : { display: "none" }
|
|
|
- }, _attrs))}></div>\`)
|
|
|
+ }))}></div>\`)
|
|
|
}"
|
|
|
`)
|
|
|
})
|
|
|
@@ -92,6 +92,24 @@ describe('ssr: v-show', () => {
|
|
|
`)
|
|
|
})
|
|
|
|
|
|
+ test('with style + display', () => {
|
|
|
+ expect(compileWithWrapper(`<div v-show="foo" style="display:flex" />`).code)
|
|
|
+ .toMatchInlineSnapshot(`
|
|
|
+ "const { ssrRenderStyle: _ssrRenderStyle, ssrRenderAttrs: _ssrRenderAttrs } = require("vue/server-renderer")
|
|
|
+
|
|
|
+ return function ssrRender(_ctx, _push, _parent, _attrs) {
|
|
|
+ _push(\`<div\${
|
|
|
+ _ssrRenderAttrs(_attrs)
|
|
|
+ }><div style="\${
|
|
|
+ _ssrRenderStyle([
|
|
|
+ {"display":"flex"},
|
|
|
+ (_ctx.foo) ? null : { display: "none" }
|
|
|
+ ])
|
|
|
+ }"></div></div>\`)
|
|
|
+ }"
|
|
|
+ `)
|
|
|
+ })
|
|
|
+
|
|
|
test('with v-bind', () => {
|
|
|
expect(
|
|
|
compileWithWrapper(
|