css控制div、span按钮置灰,点击后不触发事件

在这里插入图片描述

<span
	:class="
		props.row.status === 0 ? 'table-blue' : 'table-disable'
	"
	@click="showStatusModal(0, props.row.id)"
>
	下架
</span>

&-blue {
	cursor: pointer;
	color: blue;
	margin: 0 2px;
	text-align: center;
}
&-disable {
	pointer-events: none;
	color: #ccc;
}
  • 3
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
要实现点击触发模态框的效果,你可以使用 Bootstrap 框架提供的 Modal 组件。具体实现步骤如下: 1. 在 HTML 文档中引入 Bootstrap 的 CSS 和 JS 文件。 ``` <link rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/4.5.3/css/bootstrap.min.css"> <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <script src="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/4.5.3/js/bootstrap.min.js"></script> ``` 2. 在 HTML 文档中添加一个按钮,设其 data-toggle 和 data-target 属性。 ``` <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal"> 点击触发模态框 </button> ``` 其中,data-toggle 属性用于告诉 Bootstrap 这是一个触发模态框的按钮,data-target 属性用于指定要触发的模态框的 ID。 3. 在 HTML 文档中添加一个模态框,设其 ID 和相关内容。 ``` <div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="exampleModalLabel">模态框标题</h5> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> </div> <div class="modal-body"> 模态框内容 </div> <div class="modal-footer"> <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button> <button type="button" class="btn btn-primary">保存修改</button> </div> </div> </div> </div> ``` 其中,ID 必须与上面的 data-target 属性值相同。模态框中的内容可以根据需求自行修改。 4. 完成后,你就可以在页面上看到一个按钮点击它就可以触发模态框了。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值