实现下方效果,之前写了五个按钮,在每个按钮上加class样式、icon图标、@click点击。
后来有位大佬重新写了,感觉没有之前繁琐,在此记录一下。
按钮04 禁用状态
html
<div>
<el-row>
<el-col v-for="(item, index) in butList" :key="index" :span="4">
<el-button type="text" :disabled="item.type" @click="butClick(index)">
<i :class="item.icon"
:style="{ background: (item.type ? '#46b2bf' : (index == butInde