实现下方效果,之前写了五个按钮,在每个按钮上加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
最后
以上就是追寻奇迹最近收集整理的关于【vue 项目】v-for循环写相同样式按钮、并分别对按钮进行接口调用以及禁用htmlscript的全部内容,更多相关【vue内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复