Skip to content

SSR: style binding keeps falsy values #9231

Closed
@KaelWD

Description

@KaelWD

Version

2.5.21

Reproduction link

https://codesandbox.io/s/o95x14r0xz (I know, minimal repro below)

Steps to reproduce

View page source

What is expected?

<div class="v-responsive" style="height:480px;" data-v-2a183b29>

What is actually happening?

<div class="v-responsive" style="height:480px;max-height:undefined;max-width:undefined;width:undefined;" data-v-2a183b29>

Reproduce in vue/test/ssr/ssr-string.spec.js then run npm run test:ssr:

  it('falsy style value', done => {
    renderVmWithOptions({
      template: '<div :style="style"></div>',
      data: {
        style: {
          opacity: 0,
          color: null
        }
      }
    }, result => {
      expect(result).toContain(
        '<div data-server-rendered="true" style="opacity:0;></div>'
      )
      done()
    })
  })

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions