[Element UI] Solve the problem that the el-tooltip prompt does not take effect when the el-button is disabled

Article directory

Problem Description

  • Key code:
<el-tooltip
	content="一段提示内容"
	placement="bottom"
	effect="light"
	:disabled="count >= 100"
>
	<el-button
		type="text"
        class="dl-button"
        :disabled="count < 100"
    >
    选择
	</el-button>
</el-tooltip>

Solution

  • Wrap a layer of tags between el-tooltip and el-button, such as div
<el-tooltip
	content="一段提示内容"
	placement="bottom"
	effect="light"
	:disabled="count >= 100"
>
	<div>
		<el-button
			type="text"
            class="dl-button"
            :disabled="count < 100"
         >
         选择
         </el-button>
	</div>
</el-tooltip>

Guess you like

Origin blog.csdn.net/qq_45677671/article/details/134028757