Skip to content
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

feat: add useCSSModule api #420

Merged
merged 1 commit into from
Jul 5, 2020
Merged

Conversation

yoyo930021
Copy link
Member

@yoyo930021 yoyo930021 commented Jul 3, 2020

Fixed #21

@antfu
Copy link
Member

antfu commented Jul 3, 2020

Thanks for the PR!

But sorry I don't think it belongs to the Composition API. And since it only relies on the public API getCurrentInstance, I think you can create a library of it and publish to npm for people to use. :) Sorry, my bad.

@yoyo930021
Copy link
Member Author

yoyo930021 commented Jul 3, 2020

It is built-in in vue-next. Code link
So it will help us migrate to Vue 3.

Copy link
Member

@pikax pikax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add some tests?

@yoyo930021
Copy link
Member Author

Can you add some tests?

Hmm...
I cannot find related tests in vue-next.

We maybe need vue-loader and compile SFC file for the test.
I will study when free time.

Copy link
Member

@antfu antfu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks.

I don't think tests are must-have here since the only thing it does is to expose an attribute. It mainly depends on the bundling environments, setting up tests for this particular case costs a bit too much but little to gain.

@yoyo930021
Copy link
Member Author

LGTM, thanks.

I don't think tests are must-have here since the only thing it does is to expose an attribute. It mainly depends on the bundling environments, setting up tests for this particular case costs a bit too much but little to gain.

I agree with you,
So I didn't add any tests at the first time.
😆

@antfu antfu merged commit 1ceac1d into vuejs:master Jul 5, 2020
@dodas
Copy link

dodas commented Jul 5, 2020

Is there some documentation, explaining how this should be used?
Thanks.

@antfu
Copy link
Member

antfu commented Jul 5, 2020

@dodas
Copy link

dodas commented Jul 5, 2020

Ahh, so useCssModule() just returns what you currently have under this.$style, right?
Thanks.

@antfu
Copy link
Member

antfu commented Jul 5, 2020

Yes

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

Successfully merging this pull request may close these issues.

Cannot work with CSS Modules
4 participants