arktosk / vue-jss-plugin

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

[POC] Add vue instance as a reactivity manager #20

Open arktosk opened 4 years ago

arktosk commented 4 years ago

Add independent Vue instance inside the plugin that will guard all the changes inside the style functions.

const style = {
    button(theme) {
        return {
            color: this.componedDefinedColor,
            background: theme.button.main.background,
        };
    },
};

Styles should be parsed and all functions will be inserted to the Vue instance as a computed property.

() => {} => Vue

Vue should trigger the JSS update.

Questions:

  1. How to bind the existing component to this in style function?
  2. How to pass separate Vue instance as a theme? Or theme should be imported from the plugin?