<div :class="$style.tab">
<router-link to="/home" :class="$style["tab-item"]"> <span class="icon iconfont icon-home"></span></router-link>
<router-link to="/discover" :class="$style["tab-item"]"> <span class="icon iconfont icon-discover"></span></router-link>
<router-link to="/goods" :class="$style["tab-item"]"> <span class="icon iconfont icon-kinds"></span></router-link>
<router-link to="/mine" :class="$style["tab-item"]"> <span class="icon iconfont icon-mine"></span></router-link>
</div>
//
.router-link-active {
color: red;
}
all styles bound through $style are correct. Cssmodules escapes style names, but router-link-active is bound only when routing is activated. Check that element style names are available, but not compiled. The style does not have a
. How can I bind it correctly?