Skip to content

Problem using CSS Modules #66

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
chanon opened this issue Feb 18, 2017 · 4 comments
Closed

Problem using CSS Modules #66

chanon opened this issue Feb 18, 2017 · 4 comments
Labels

Comments

@chanon
Copy link

chanon commented Feb 18, 2017

Using vue-class-component, I can not reference CSS Module css class name using $style.className in the template.

See reproduction:
https://github.com/chanon/ts-vue-hmr/blob/master/src/components/Hello.vue#L13

It creates a runtime error in the browser:
image

I tried to create property / data declaration of $style but I could not get it to work.

@chanon chanon changed the title CSS Modules is unsupported Problem using CSS Modules Feb 18, 2017
@chanon
Copy link
Author

chanon commented Feb 18, 2017

For reference av-ts does not have this problem.

@ktsn
Copy link
Member

ktsn commented Feb 21, 2017

Move to vuejs/vue#4976

@ktsn ktsn closed this as completed Feb 21, 2017
@snaptopixel
Copy link

snaptopixel commented Feb 21, 2017

Hey @chanon looks like the team is working on this but I had the same issue you've mentioned. I show a workaround here: vuejs/vue-loader#540

@Astray-git
Copy link

mounted() { console.log(this.$style) }

As the original issue is fixed. I still get error Property '$style' does not exist on type MyComponent with [email protected].

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

No branches or pull requests

5 participants