Skip to content

$style not set when using vue-class-component decorator #540

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
snaptopixel opened this issue Dec 16, 2016 · 2 comments
Closed

$style not set when using vue-class-component decorator #540

snaptopixel opened this issue Dec 16, 2016 · 2 comments

Comments

@snaptopixel
Copy link

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...

@HerringtonDarkholme
Copy link
Member

Root cause should be: vuejs/vue#4976

@yyx990803
Copy link
Member

Original issue is fixed now. Will be out in Vue core 2.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants