I'm working on a proof of concept with TypeScript and vue-class-component and have an issue with <style module> not working.
Basically the computed $styles property never ends up on the exported definition. This only happens when the component has no other computed properties defined. If you add a placeholder it will work:
get $style() {
return {};
}
I believe this is just the nature of the beast with the way annotations work. Since the options are wrapped in a closure, if you don't have a reference to the computed object in there from the start then the logic in vue-loader that defines computed[$style] puts it in the wrong place.
I'm not sure that there is a way to fix it (other than the workaround mentioned) but I figured I would put this up for discussion. I made an update to vue-class-component to define a computed object if one is not provided which works, but seems like an edge case that doesn't belong in that lib...
Root cause should be: https://github.com/vuejs/vue/issues/4976
Original issue is fixed now. Will be out in Vue core 2.2.
Most helpful comment
Original issue is fixed now. Will be out in Vue core 2.2.