页面样式为:
html 代码为:文章来源:https://www.toymoban.com/news/detail-612804.html
日志等级:
<el-radio-group v-model="logLevel">
<el-radio-button label="DEBUG" @click.native.prevent="changeLogLevel('DEBUG')">DEBUG</el-radio-button>
<el-radio-button label="INFO" @click.native.prevent="changeLogLevel('INFO')">INFO</el-radio-button>
<el-radio-button label="ERROR" @click.native.prevent="changeLogLevel('ERROR')">ERROR</el-radio-button>
</el-radio-group>
js代码为:(记得在data中声明loglevel:"")文章来源地址https://www.toymoban.com/news/detail-612804.html
changeLogLevel(val) {
if (this.logLevelChecked && val == this.logLevel) {
this.logLevelChecked = "";
this.logLevel = "";
this.getLogAggregation();
} else {
this.logLevelChecked = 1;
this.logLevel = val;
this.getLogAggregation();
}
}
到了这里,关于VUE中使用ElementUI组件的单选按钮el-radio-button实现第二点击时取消选择的功能的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!