fix(compiler-ssr): fix SSR issue when dynamic and static class co-exist (#2354)

This commit is contained in:
Mathieu TUDISCO
2020-10-13 22:25:15 +02:00
committed by GitHub
parent 6a554feb13
commit 8539c0bf32
4 changed files with 33 additions and 5 deletions

View File

@@ -112,6 +112,15 @@ describe('ssr: element', () => {
`)
})
test('v-bind:class + static class', () => {
expect(getCompiledString(`<div :class="bar" class="foo"></div>`))
.toMatchInlineSnapshot(`
"\`<div class=\\"\${
_ssrRenderClass([_ctx.bar, \\"foo\\"])
}\\"></div>\`"
`)
})
test('v-bind:style', () => {
expect(getCompiledString(`<div id="foo" :style="bar"></div>`))
.toMatchInlineSnapshot(`