vue+vue+el-table, , , , , false, , , this
,
html
<el-table-column width="70">
<template slot-scope="scope">
<div class="switch">
<img class="suspend" v-if="suspendBtn" @click="start(scope.row)" src="../../../../assets/index/start_hover.png">
<img class="start" v-if="startBtn" @click="suspend" src="../../../../assets/index/suspended.png">
</div>
</template>
</el-table-column>
js
data() {
return {
startBtn: false,
suspendBtn: true,
};
},
methods: {
start() {
this.startBtn = true;
this.suspendBtn = false;
},
suspend() {
this.startBtn = false;
this.suspendBtn = true;
}
}