提交 4a20e5cc 编写于 作者: S shiziyuan9527

refactor: 优化变量命名

上级 e5c4885d
<template>
<div v-if="isShow">
<el-dropdown placement="bottom" trigger="click" size="medium">
<div @click.stop="click" class="show-more-btn">
<div @click.stop class="show-more-btn">
<i class="el-icon-more ms-icon-more"/>
</div>
<el-dropdown-menu slot="dropdown" class="dropdown-menu-class">
<div class="show-more-btn-title">{{$t('test_track.case.batch_handle', [size])}}</div>
<el-dropdown-item v-for="(btn,index) in buttons" :key="index" @click.native.stop="clickStop(btn)">
<el-dropdown-item v-for="(btn,index) in buttons" :key="index" @click.native.stop="click(btn)">
{{btn.name}}
</el-dropdown-item>
</el-dropdown-menu>
......@@ -17,19 +17,6 @@
<script>
export default {
name: "ShowMoreBtn",
data() {
return {}
},
methods: {
click() {
// console.log("click");
},
clickStop(btn) {
if (btn.stop instanceof Function) {
btn.stop();
}
}
},
props: {
isShow: {
type: Boolean,
......@@ -38,6 +25,13 @@
buttons: Array,
row: Object,
size: Number
},
methods: {
click(btn) {
if (btn.handleClick instanceof Function) {
btn.handleClick();
}
}
}
}
</script>
......
......@@ -191,11 +191,11 @@
showMore: false,
buttons: [
{
name: '批量编辑用例', stop: this.handleClickStop
name: '批量编辑用例', handleClick: this.handleBatchEdit
}, {
name: '批量移动用例', stop: this.handleMove
name: '批量移动用例', handleClick: this.handleBatchMove
}, {
name: '批量删除用例', stop: this.handleDeleteBatch
name: '批量删除用例', handleClick: this.handleDeleteBatch
}
]
}
......@@ -428,10 +428,10 @@
_sort(column, this.condition);
this.initTableData();
},
handleClickStop() {
handleBatchEdit() {
this.$refs.batchEdit.open();
},
handleMove() {
handleBatchMove() {
this.$emit("batchMove", Array.from(this.selectRows).map(row => row.id));
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册