A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/vuejs/vue/commit/1a979c44d6543d89f8a7e26ad7f995b1bf2aee3c below:

fix v-show inline style rendering when style binding is arr… · vuejs/vue@1a979c4 · GitHub

File tree Expand file treeCollapse file tree 2 files changed

+16

-1

lines changed

Filter options

Expand file treeCollapse file tree 2 files changed

+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