我有一个纽芬兰语,在点击时打开了一种模式,在模式中显示的内容是以传送到纽伦的数据为根据的。
My button,
<button class="btn btn-info" data-toggle="modal"
data-target="#someModal" :data-id=item.id :data-name=item.name>
Edit
</button>
在我的模式中,我有一些纽芬兰语,在被点击时,我应该用一个参数,即数据输入。
我的表,,
<div class="modal-footer">
<button type="button" class="btn btn-danger"
@click.prevent="deleteItem()" data-dismiss="modal">
Delete
</button>
<button type="button" class="btn btn-warning" data-dismiss="modal">
<span class= glyphicon glyphicon-remove ></span> Close
</button>
</div>
在此,我不得不通过一个参数到<代码>deleteItem(),该参数为data-id
,我从上述纽特获得。
Code for Modal
<div id="deleteModal" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Delete</h4>
</div>
<div class="modal-body">
<div class="deleteContent">
Are you Sure you want to delete ?
</div>
<div class="modal-footer">
<button type="button" class="btn actionBtn btn-danger"
@click.prevent="deleteItem()"
data-dismiss="modal">
Delete <span id="footer_action_button"
class= glyphicon glyphicon-trash > </span>
</button>
<button type="button" class="btn btn-warning"
data-dismiss="modal">
<span class= glyphicon glyphicon-remove ></span> Close
</button>
</div>
</div>
</div>
</div>
</div>