[Feature Request]Support access css module in top level of SFC
What problem does this feature solve?
For Vue3, useCssModule
can only be called in setup
.
For Vue2, $style
can only be accessed by instance.
Sometimes i want to use css module in SFC but outside instance scope, such as:
// component.vue
<script>
export function someExportedFn() {
// how can i get css module here?
}
</script>
I don't think technically this should be prevented, css module should be accessible from anywhere in SFC.
What does the proposed API look like?
I haven't found a perfect solution yet. It seems use loader
to resolve the problem is a feasible way.