Elementui 的按钮el-button点击切换class
程序员文章站
2022-06-07 11:06:43
...
完整代码
<template>
<div class="type-check">
<el-button :type="0==display?'success':'default'" size="mini" @click="displayCheck(0)">表格 </el-button>
<el-button :type="1==display?'success':'default'" size="mini" @click="displayCheck(1)">图表</el-button>
</div>
</template>
export default {
data() {
return {display: "0",};
},
methods: {
displayCheck(flat) {this.display=flat},
}
};
下一篇: Steps步骤条结合路由跳转