Bootstrap可变模式内容

我有一堆都触发相同模式的内容,但是,每个内容都略有不同,我已经按照引导程序指南设法更改了标题和说明,但似乎无法更新图标。或者,是否有一种方法可以将链接中的h3和P标签作为目标以通过该信息,或者将数据属性添加到每个链接是最好的方法? (对不起,我的JS知识不是很好)

链接

<a data-desc="this is a test" data-image="/build/images/app-icons/slack.svg" data-title="Slack 3" data-target="#appListModal" data-toggle="modal" href="">
<div class="media">
<img alt="Generic placeholder image" class="mr-3 app-icon" id="a-icon" src="/build/images/app-icons/slack.svg">
<div class="media-body">
  <h3 class="mt-0" id="app-title">Slack</h3>
  <p>Team and client communication</p>
</div>
</div>
</a>

JS

$('#appListModal').on('show.bs.modal', function (event) {
var button = $(event.relatedTarget) // Button that triggered the modal
var apptitle = button.data('title')
var appdesc = button.data('desc')
var image = button.data('image')

// Extract info from data-* attributes
// If necessary, you could initiate an AJAX request here (and then do the updating in a callback).
// Update the modal's content. We'll use jQuery here, but you could use a data binding library or other methods instead.
var modal = $(this)
modal.find('.modal-title').text(apptitle)
modal.find('.modal-desc').text(appdesc)
modal.find('modal-icon').src = (image)   })