<style module> .red { color: red; } .bold { font-weight: bold; } </style> <template> <p :class="$style.red"> This should be red {{$style.red}} </p> </template>
升级版-对模块进行命名
1 2 3 4 5 6 7 8 9 10 11
<style module="a"> /* identifiers injected as a */ .yellow{ color:yellow; } </style> <template> <p :class="a.yellow"> This should be red {{a.yellow}} </p> </template>