如何在select2多个标签中获取输入列表

How to get list of input in select2 multiple tags

我想获取我在 select2 输入框中输入的电子邮件 ID 列表。 这是我的观点
UI of my select2

我想获取我在输入框中输入的电子邮件列表,然后我想在 ajax 调用中发送。

这是我的 HTML

<div class="col-9">
  <div class="input-holder">
        <select class="mail-input select-2-input" multiple="multiple">
        </select>
    </div>
</div>

这是我的js

 $(".select-2-input").select2({
    tags : true,
    placeholder : "Enter Business Email",
    tokenSeparators : [ ',', ' ' ]
})

从select2获取数据

console.log($(".select-2-input").select2('data'));

获取价值

console.log($(".select-2-input").select2("val"));