html代码
<template slot-scope="scope"> <el-button v-for="(item, index) in tableBtn" :key="index" size="mini" :type="item.type" @click="tabFun(item, scope.row)" >{{ item.name }}</el-button > </template>
2、js
//data
tableBtn: [{
type: "primary",
icon: "el-icon-document",
click: "handleReport",
name: "报告"
},
{
type: "success",
icon: "el-icon-picture-outline",
click: "handleImage",
name: "图像"
}, {
type: "primary",
icon: "el-icon-plus",
click: "handleAdd",
name: "新增"
},
{
type: "danger",
icon: "el-icon-delete",
click: "handleDelete",
name: "删除"
}],
//methods
tabFun(btn, row) {
if (this[btn.click]) {
this[btn.click](btn, row);
} else {
console.log("方法未定义!");
}
},
//报告事件
handleReport(index, row) {
console.log("handleReport");
},
//图像事件
handleImage(index, row) {
console.log("handleImage");
},
//新增事件
handleAdd(index, row) {
console.log("handleAdd");
},
//删除事件
handleDelete(index, row) {
console.log("handleDelete");
}
上面是“el-button按钮实现v-for遍历”的全面内容,想了解更多关于 vuejs 内容,请继续关注web建站教程。
当前网址:https://ipkd.cn/webs_1701.html
workflows工作流
一个浑身皮毛看起来像丘巴卡的3d动漫人物
一只千纸鹤坐在路上哭泣ComfyUI工作流
城市里出现一只可爱的小生物ComfyUI工作流
一个闪闪发光的金属球ComfyUI工作流
一条精致透明的朱红色水晶龙
一张严重受损的宇宙飞船的照片ComfyUI工作流
一名男子跪在月球岩石表面看见小行星碰撞
三阶放大comfyui工作流
猜你喜欢
声明:本站提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请发送到邮箱:admin@ipkd.cn,我们会在看到邮件的第一时间内为您处理!

用ascii字符画图像
用svg画出游泳池动画效果
一个包含老黄历、佛历、道历、星宿等数据的日历网站
css3动画loading效果
利用html5+css3实现滚雪球效果(附代码)
如何利用css3+js做一个下雨效果
利用js+css3做一个小鱼游泳特效
iframe开发admin后台











