+16
-1
lines changedFilter options
+16
-1
lines changed Original file line number Diff line number Diff line change
@@ -3,6 +3,10 @@
3
3
export default function show (node: VNodeWithData, dir: VNodeDirective) {
4
4
if (!dir.value) {
5
5
const style: any = node.data.style || (node.data.style = {})
6
-
style.display = 'none'
6
+
if (Array.isArray(style)) {
7
+
style.push({ display: 'none' })
8
+
} else {
9
+
style.display = 'none'
10
+
}
7
11
}
8
12
}
Original file line number Diff line number Diff line change
@@ -267,6 +267,17 @@ describe('SSR: renderToString', () => {
267
267
})
268
268
})
269
269
270
+
it('v-show directive merge with style', done => {
271
+
renderVmWithOptions({
272
+
template: '<div :style="[{lineHeight: 1}]" v-show="false"><span>inner</span></div>'
273
+
}, res => {
274
+
expect(res).toContain(
275
+
'<div data-server-rendered="true" style="line-height:1;display:none;"><span>inner</span></div>'
276
+
)
277
+
done()
278
+
})
279
+
})
280
+
270
281
it('v-show directive not passed to child', done => {
271
282
renderVmWithOptions({
272
283
template: '<foo v-show="false"></foo>',
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4