fix(compiler-dom): properly stringify class/style bindings when hoisting static strings
This commit is contained in:
@@ -101,7 +101,7 @@ describe('ssr: element', () => {
|
||||
expect(
|
||||
getCompiledString(`<div style="color:red;" :style="bar"></div>`)
|
||||
).toMatchInlineSnapshot(
|
||||
`"\`<div style=\\"\${_ssrRenderStyle([_hoisted_1, _ctx.bar])}\\"></div>\`"`
|
||||
`"\`<div style=\\"\${_ssrRenderStyle([{\\"color\\":\\"red\\"}, _ctx.bar])}\\"></div>\`"`
|
||||
)
|
||||
})
|
||||
|
||||
@@ -184,7 +184,7 @@ describe('ssr: element', () => {
|
||||
)
|
||||
).toMatchInlineSnapshot(`
|
||||
"\`<div\${_ssrRenderAttrs(_mergeProps({
|
||||
style: [_hoisted_1, _ctx.b]
|
||||
style: [{\\"color\\":\\"red\\"}, _ctx.b]
|
||||
}, _ctx.obj))}></div>\`"
|
||||
`)
|
||||
})
|
||||
|
||||
@@ -16,11 +16,9 @@ describe('ssr: v-show', () => {
|
||||
.toMatchInlineSnapshot(`
|
||||
"const { ssrRenderStyle: _ssrRenderStyle } = require(\\"@vue/server-renderer\\")
|
||||
|
||||
const _hoisted_1 = {\\"color\\":\\"red\\"}
|
||||
|
||||
return function ssrRender(_ctx, _push, _parent) {
|
||||
_push(\`<div style=\\"\${_ssrRenderStyle([
|
||||
_hoisted_1,
|
||||
{\\"color\\":\\"red\\"},
|
||||
(_ctx.foo) ? null : { display: \\"none\\" }
|
||||
])}\\"></div>\`)
|
||||
}"
|
||||
@@ -48,11 +46,9 @@ describe('ssr: v-show', () => {
|
||||
).toMatchInlineSnapshot(`
|
||||
"const { ssrRenderStyle: _ssrRenderStyle } = require(\\"@vue/server-renderer\\")
|
||||
|
||||
const _hoisted_1 = {\\"color\\":\\"red\\"}
|
||||
|
||||
return function ssrRender(_ctx, _push, _parent) {
|
||||
_push(\`<div style=\\"\${_ssrRenderStyle([
|
||||
_hoisted_1,
|
||||
{\\"color\\":\\"red\\"},
|
||||
{ fontSize: 14 },
|
||||
(_ctx.foo) ? null : { display: \\"none\\" }
|
||||
])}\\"></div>\`)
|
||||
@@ -69,12 +65,10 @@ describe('ssr: v-show', () => {
|
||||
"const { mergeProps: _mergeProps } = require(\\"vue\\")
|
||||
const { ssrRenderAttrs: _ssrRenderAttrs } = require(\\"@vue/server-renderer\\")
|
||||
|
||||
const _hoisted_1 = {\\"color\\":\\"red\\"}
|
||||
|
||||
return function ssrRender(_ctx, _push, _parent) {
|
||||
_push(\`<div\${_ssrRenderAttrs(_mergeProps(_ctx.baz, {
|
||||
style: [
|
||||
_hoisted_1,
|
||||
{\\"color\\":\\"red\\"},
|
||||
{ fontSize: 14 },
|
||||
(_ctx.foo) ? null : { display: \\"none\\" }
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user