A RetroSearch Logo

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

Search Query:

Showing content from https://github.com/vuejs/vue/issues/7813 below:

[SSR] lost v-show if style is to binding to an array · Issue #7813 · vuejs/vue · GitHub

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


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