<template >
<div>
</div>
</template>
此文章为自己使用,不足的地方欢迎评论,持续更新;vue3.0+element
1.使用插槽的几种情况
在table中使用
<el-table-column prop="" label="操作" width="160">
<template slot-scope="scope">
<el-button
class="chakan"
size="mini"
type="primary"
@click="handleLook(scope.$index, scope.row)"
>查看</el-button
>
<el-button
class="shanchu"
size="mini"
type="danger"
@click="handleDelete(scope.$index, scope.row)"
>删除</el-button
>
</template>
</el-table-column>
在setps中使用
<el-steps :active="setpValue" process-status="process" align-center>
<el-step
:title="item.title"
:description="item.text"
:key="item.index"
v-for="item in stepsList"
>
<!-- <template v-slot:title>
<div>
<div v-if="item.id==1">
未开始
</div>
<div v-if="item.id==2">
已开始
</div>
</div>
</template> -->
</el-step>
</el-steps>
2.el-table去掉每行底部自带的横线
<el-table :cell-style="{border:0 + 'px' }">//去掉每行下面的横线
3.ElMessageBox删除提示框
ElMessageBox.confirm("此操作将永久删除该文件, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(async () => {
let data = {
id:'1',
name:'内容',
};
let res = await postAxios(data);
ElMessage({
type: "success",
message: "删除成功!",
});
})
.catch(() => {
ElMessage({
type: "info",
message: "已取消删除",
});
});