mirror of
https://gitee.com/vuejs/vue.git
synced 2024-12-05 05:27:59 +08:00
parent
59860b0a75
commit
c21b89ebed
@ -92,7 +92,7 @@ export function genClassSegments (
|
|||||||
classBinding: ?string
|
classBinding: ?string
|
||||||
): Array<StringSegment> {
|
): Array<StringSegment> {
|
||||||
if (staticClass && !classBinding) {
|
if (staticClass && !classBinding) {
|
||||||
return [{ type: RAW, value: ` class=${staticClass}` }]
|
return [{ type: RAW, value: ` class="${JSON.parse(staticClass)}"` }]
|
||||||
} else {
|
} else {
|
||||||
return [{
|
return [{
|
||||||
type: EXPRESSION,
|
type: EXPRESSION,
|
||||||
|
@ -1245,6 +1245,20 @@ describe('SSR: renderToString', () => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// #7859
|
||||||
|
it('should not double escape class values', done => {
|
||||||
|
renderVmWithOptions({
|
||||||
|
template: `
|
||||||
|
<div>
|
||||||
|
<div class="a\nb"></div>
|
||||||
|
</div>
|
||||||
|
`
|
||||||
|
}, result => {
|
||||||
|
expect(result).toContain(`<div class="a\nb"></div>`)
|
||||||
|
done()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
it('should expose ssr helpers on functional context', done => {
|
it('should expose ssr helpers on functional context', done => {
|
||||||
let called = false
|
let called = false
|
||||||
renderVmWithOptions({
|
renderVmWithOptions({
|
||||||
|
Loading…
Reference in New Issue
Block a user