arktosk / vue-jss-plugin

JSS plugin implementation for Vue.js
MIT License
24 stars 1 forks source link

Reactive Styles? #33

Closed bgarchow closed 3 years ago

bgarchow commented 3 years ago

Thank you for writing this plugin. I installed the plugin and created a very simple app. When app is rendered, its background color is blue as expected. Clicking on app updatesdata property bgColor to red as expected but the background color of app remains blue. Are additional configuration options required for this to work or is it not possible with this plugin?

<template>
  <div id="app" :class="$classes.app"  @click="onClick"></div>
</template>

<script>
  export default {
    name: 'App',
    styles: {
      app: {
        width: 100,
        height: 100,
        backgroundColor: ({ bgColor }) => bgColor
      }
    },
    data() {
      return {
        bgColor: 'blue'
      }
    },
    methods: {
      onClick() {
        this.bgColor = 'red'
      }
    }
  }
</script>
arktosk commented 3 years ago

Hey, please provide the version of vue that you used alongside the plugin. The plugin was tested only with Vue@2.6.x, so when you are using different version, then will be very helpful to know the Vue veriosn when debugging.

bgarchow commented 3 years ago

Thank you for your reply. Vue version was 2.6.11 but I have since decided not to use JSS for my project.