Skip to content

[SSR] lost v-show if style is to binding to an array #7813

Closed
@jinzhubaofu

Description

@jinzhubaofu

Version

2.5.15

Reproduction link

https://codepen.io/ludafa/pen/Broxxy

Steps to reproduce

  1. npm install vue vue-server-render
  2. new a index.js with this code:
const Vue = require('vue')
const app = new Vue({
  template: `<div :style="[{color: a, background: b}]" v-show="c">test</div>`,
  data() {
    return {
      a: 'red',
      b: 'blue',
      c: false
    };
  }
})
const renderer = require('vue-server-renderer').createRenderer()
renderer.renderToString(app, (err, html) => {
  if (err) throw err
  console.log(html)
})
  1. run: node index.js

What is expected?

<div data-server-rendered="true" style="color:red;background:blue;display:none;">test</div>

What is actually happening?

<div data-server-rendered="true" style="color:red;background:blue;">test</div>

Please run the CodePen on Node

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions