Skip to content

[Vue 2.0] Issue with styles as array and reactivity #3657

Closed
@probil

Description

@probil

First of all, thank you for you work. Vue.js is awesome 😎

But I have an issue with reactivity and style binding as array in Vue 2.0-rc.5 . I have used this syntax:

:style="[object1,object2]"

In this case object2 used only one on init render. When I change object2 prop, actual style is not changed. Even through I can see changes in devtools. So it's not reactive. It was working on Vue 1.X without such issue at all.

If it's not a bug but feature (I don't think so), please, describe it in docs.

Vue.js version

2.0.0-rc.5

Reproduction Link

First one (with computed properties)
https://jsfiddle.net/probil/ztcrvLeo/

Second one (simplier)
https://jsfiddle.net/probil/017Lqvvh/

Steps to reproduce

  1. Create two objects in data() -> object1 and object2.
  2. Describe some styles in object1. In object2 describe backgroundImage
  3. Create element with :style=[object1,object2]
  4. Change backgroundImage to another image of object2 (on button click for example)
  5. See no changes on the screen

What is Expected?

Images should be changed. It works great in Vue 1.X . Proof link https://jsfiddle.net/6f7r6b8b/2/

What is actually happening?

Images is is not changed. Even through I see actual changes in vue-devtools.

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