A RetroSearch Logo

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

Search Query:

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

should render 0 as valid value for style property with unit · vuejs/vue@aef5b4e · GitHub

File tree Expand file treeCollapse file tree 2 files changed

+5

-3

lines changed

Filter options

Expand file treeCollapse file tree 2 files changed

+5

-3

lines changed Original file line number Diff line number Diff line change

@@ -23,7 +23,8 @@ export function genStyle (style: Object): string {

23 23

function normalizeValue(key: string, value: any): string {

24 24

if (

25 25

typeof value === 'string' ||

26 -

(typeof value === 'number' && noUnitNumericStyleProps[key])

26 +

(typeof value === 'number' && noUnitNumericStyleProps[key]) ||

27 +

value === 0

27 28

) {

28 29

return `${key}:${value};`

29 30

} else {

Original file line number Diff line number Diff line change

@@ -1529,13 +1529,14 @@ describe('SSR: renderToString', () => {

1529 1529

data: {

1530 1530

style: {

1531 1531

opacity: 0, // valid, opacity is unit-less

1532 -

top: 0, // invalid, top requires unit

1532 +

top: 0, // valid, top requires unit but 0 is allowed

1533 +

left: 10, // invalid, left requires a unit

1533 1534

marginTop: '10px' // valid

1534 1535

}

1535 1536

}

1536 1537

}, result => {

1537 1538

expect(result).toContain(

1538 -

'<div data-server-rendered="true" style="opacity:0;margin-top:10px;"></div>'

1539 +

'<div data-server-rendered="true" style="opacity:0;top:0;margin-top:10px;"></div>'

1539 1540

)

1540 1541

done()

1541 1542

})

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