一、修改弹窗层-title 1. 定义一个变量 dailogTitleType <el-dialog :title="dailogTitleType+'图片'" :visible.sync="dialogVisible" width="500px" ></el-dialog> 2. 返回一个空的变量 export default { data() { return { dialogTitleType:'' } } } 3. 在对应按钮的onclik方法里加入dialogTitleType变量的默认值 <el-button type="primary" size="mini" @click="handleAdd">添加图片</el-button> <el-button type="primary" size="mini" @click="handleEdit">编辑</el-button> //点击新增按钮触发函数 handleAdd: function(index, row) { this.dailogTitleType ="添加"; this.addPictureDialogVisible = true; this.form = Object.assign({}, row); }, //点击编辑按钮触发函数 handleEdit: function(index, row) { this.dailogTitleType ="编辑"; this.addPictureDialogVisible = true; this.form = Object.assign({}, row); }, 二、点击弹窗层关闭按钮 el-dialog :title="dailogTitleType" :visible.sync="tanchu4" class="create2" :before-close="handleDialogClose"></el-dialog> handleDialogClose() { //点击右上角关闭按钮 alert("点击了关闭按钮") }, //监听点击第几个根据-demoTabNav定义的这个值 <div class="layui-tab layui-tab-brief" lay-filter="demoTabNav" id="demoTabNavId"> <ul class="layui-tab-title"> <li class="layui-this">任务统计</li> <li>人员列表</li> <li>任务详情</li> </ul> </div> element.on('tab(demoTabNav)', function(data){ alert(data.index); }); select 选择事件 @change="(e)=>projectIdClick(e,scope.$index )" setInterval(() =>{ // console.log(that.getFavoritesQuestion.length, '测222222') },2000) scope.$index 表格获取**索引** v-if="userMenu.indexOf('expert:trainMethod')!==-1" 数组包含 this.$router.back(); //返回上一页