How to write button label style and function disabled in vue

Problems encountered in recording work:

Requirement: When the test paper is released, if the total score exceeds 100, the button is not allowed to be clicked

Technology stack used: Vue3 element-Plus 

HTML code:

<el-button type="primary" @click="onSubmitExam" >试题生成</el-button>

The button looks like this:

Now add the disabled attribute, and if the total score exceeds 100, it will be grayed out and disabled

<el-button type="primary" @click="onSubmitExam" :disabled="showScore > 100 ? true : false">试题生成</el-button>

 Here, what I judge is the total score, and use the three-eye operation to control the attributes of the button

This article cites other people's articles about the style of button tags and disabled functions in vue_vue.js_Script House (jb51.net)

Guess you like

Origin blog.csdn.net/Daisy_ls/article/details/128013321