@@ -8,6 +8,7 @@ describe('ssr: v-if', () => {
8
8
return function ssrRender(_ctx, _push, _parent, _attrs) {
9
9
if (_ctx.foo) {
10
10
_push(\`<div\${_ssrRenderAttrs(_attrs)}></div>\`)
11
+ _push(\`<!--$-->\`)
11
12
} else {
12
13
_push(\`<!---->\`)
13
14
}
@@ -23,6 +24,7 @@ describe('ssr: v-if', () => {
23
24
return function ssrRender(_ctx, _push, _parent, _attrs) {
24
25
if (_ctx.foo) {
25
26
_push(\`<div\${_ssrRenderAttrs(_attrs)}>hello<span>ok</span></div>\`)
27
+ _push(\`<!--$-->\`)
26
28
} else {
27
29
_push(\`<!---->\`)
28
30
}
@@ -38,6 +40,7 @@ describe('ssr: v-if', () => {
38
40
return function ssrRender(_ctx, _push, _parent, _attrs) {
39
41
if (_ctx.foo) {
40
42
_push(\`<div\${_ssrRenderAttrs(_attrs)}></div>\`)
43
+ _push(\`<!--$-->\`)
41
44
} else {
42
45
_push(\`<span\${_ssrRenderAttrs(_attrs)}></span>\`)
43
46
}
@@ -53,8 +56,10 @@ describe('ssr: v-if', () => {
53
56
return function ssrRender(_ctx, _push, _parent, _attrs) {
54
57
if (_ctx.foo) {
55
58
_push(\`<div\${_ssrRenderAttrs(_attrs)}></div>\`)
59
+ _push(\`<!--$-->\`)
56
60
} else if (_ctx.bar) {
57
61
_push(\`<span\${_ssrRenderAttrs(_attrs)}></span>\`)
62
+ _push(\`<!--$-->\`)
58
63
} else {
59
64
_push(\`<!---->\`)
60
65
}
@@ -70,8 +75,10 @@ describe('ssr: v-if', () => {
70
75
return function ssrRender(_ctx, _push, _parent, _attrs) {
71
76
if (_ctx.foo) {
72
77
_push(\`<div\${_ssrRenderAttrs(_attrs)}></div>\`)
78
+ _push(\`<!--$-->\`)
73
79
} else if (_ctx.bar) {
74
80
_push(\`<span\${_ssrRenderAttrs(_attrs)}></span>\`)
81
+ _push(\`<!--$-->\`)
75
82
} else {
76
83
_push(\`<p\${_ssrRenderAttrs(_attrs)}></p>\`)
77
84
}
@@ -82,15 +89,16 @@ describe('ssr: v-if', () => {
82
89
test ( '<template v-if> (text)' , ( ) => {
83
90
expect ( compile ( `<template v-if="foo">hello</template>` ) . code )
84
91
. toMatchInlineSnapshot ( `
85
- "
86
- return function ssrRender(_ctx, _push, _parent, _attrs) {
87
- if (_ctx.foo) {
88
- _push(\`<!--[-->hello<!--]-->\`)
89
- } else {
90
- _push(\`<!---->\`)
91
- }
92
- }"
93
- ` )
92
+ "
93
+ return function ssrRender(_ctx, _push, _parent, _attrs) {
94
+ if (_ctx.foo) {
95
+ _push(\`<!--[-->hello<!--]-->\`)
96
+ _push(\`<!--$-->\`)
97
+ } else {
98
+ _push(\`<!---->\`)
99
+ }
100
+ }"
101
+ ` )
94
102
} )
95
103
96
104
test ( '<template v-if> (single element)' , ( ) => {
@@ -102,6 +110,7 @@ describe('ssr: v-if', () => {
102
110
return function ssrRender(_ctx, _push, _parent, _attrs) {
103
111
if (_ctx.foo) {
104
112
_push(\`<div\${_ssrRenderAttrs(_attrs)}>hi</div>\`)
113
+ _push(\`<!--$-->\`)
105
114
} else {
106
115
_push(\`<!---->\`)
107
116
}
@@ -118,6 +127,7 @@ describe('ssr: v-if', () => {
118
127
return function ssrRender(_ctx, _push, _parent, _attrs) {
119
128
if (_ctx.foo) {
120
129
_push(\`<!--[--><div>hi</div><div>ho</div><!--]-->\`)
130
+ _push(\`<!--$-->\`)
121
131
} else {
122
132
_push(\`<!---->\`)
123
133
}
@@ -138,6 +148,7 @@ describe('ssr: v-if', () => {
138
148
_push(\`<div></div>\`)
139
149
})
140
150
_push(\`<!--]-->\`)
151
+ _push(\`<!--$-->\`)
141
152
} else {
142
153
_push(\`<!---->\`)
143
154
}
@@ -156,6 +167,7 @@ describe('ssr: v-if', () => {
156
167
return function ssrRender(_ctx, _push, _parent, _attrs) {
157
168
if (_ctx.foo) {
158
169
_push(\`<!--[--><div>hi</div><div>ho</div><!--]-->\`)
170
+ _push(\`<!--$-->\`)
159
171
} else {
160
172
_push(\`<div\${_ssrRenderAttrs(_attrs)}></div>\`)
161
173
}
0 commit comments