Bootstrap⽂件上传插件FileInput的使⽤问题
柯震东的妈妈
  在使⽤bootstrap的⽂件上传插件fileinput 的预览功能时,删除预览图⽚在 bootstrap 模态框中没有⽤,需要先点击移除,在点删除才有⽤  问题对⽐:
1.在正常页⾯中可以使⽤
<input type="file" id="test" class="form-control inline-form-control"/>
$(document).ready(function () {
var url1 = '/wikipedia/commons/thumb/e/e1/FullMoon2010.jpg/631px-FullMoon2010.jpg';
$("#test").fileinput({
initialPreview: [url1],
initialPreviewAsData: true,
initialPreviewConfig: [
{caption: "Moon.jpg", downloadUrl: url1, size: 930321, width: "120px", key: 1}
],
deleteUrl: "/watch/video/deleteimage",如何办签证
overwriteInitial: false,
maxFileSize: 100,
initialCaption: "The Moon and the Earth"
});
    $("#test2").fileinput({
initialPreview: [url1],
initialPreviewAsData: true,贾青照片
initialPreviewConfig: [
{caption: "Moon.jpg", downloadUrl: url1, size: 930321, width: "120px", key: 1}
],
博客上传视频deleteUrl: "/watch/video/deleteimage",
overwriteInitial: false,
maxFileSize: 100,
initialCaption: "The Moon and the Earth"
});
});傅艺伟老公杨晓丹
    点击删除,看到了删除请求
2.同样的代码,将 input 放到modal中
  modal代码
<div class="modal fade" id="editVideo" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">修改视频评测</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body" >
<div class="row" >
<input type="file" class="form-control" name="editfile" id="test2">
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
<button type="submit" class="btn btn-primary edit-confirm">确定</button>
</div>
鹄的读音
</div>
</div>
</div>
  js在上⽂已给出