Answer the question
In order to leave comments, you need to log in
How to generate css class name?
I use vue-cli. I use named css modules:
<template>
<div>
<div v-if="isTrue()" :class="$foo.container">...</div>
<div v-else :class="$bar.container">...</div>
</div>
</template>
<style lang="postcss" module="$foo">
.container {
color: green
}
</style>
<style lang="postcss" module="$bar">
.container {
color: red
}
</style>
localIdentName: '[hash]_[local]'
localIdentName: '[hash]_[local]_[module]'
and the output turned out to be something like:.432j4h2kj4_container_$foo {}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question