lib文件输入功能无效

时间:2017-06-19 20:15:33

标签: javascript jquery css twitter-bootstrap

我需要在我的文件上进行缩放删除,问题是这些函数在bootstrap-fileinput库中时,在尝试使用它们时它会给我带来错误,我希望这个工作主要是缩放和删除。

enter image description here

在图片中我有一个pdf但缩放按钮没有图标,当我点击按钮时出现错误:

Uncaught TypeError: n.modal is not a function
    at t._zoomPreview (eval at <anonymous> (jquery-core.js:338), <anonymous>:11:2213)
    at HTMLButtonElement.eval (eval at <anonymous> (jquery-core.js:338), <anonymous>:11:2744)
    at HTMLButtonElement.dispatch (jquery-core.js:4641)
    at HTMLButtonElement.elemData.handle (jquery-core.js:4309)

实施很简单:

<link href="../../../bower_components/bootstrap-fileinput/css/fileinput.min.css" rel="stylesheet" type="text/css" />
<script src="../../../bower_components/bootstrap-fileinput/js/fileinput.min.js"></script>

<div class="col-sm-8">
  <input class="form-control"
         type="file"
         file-model="photo_document"
         id="photo_document"
         name="photo_document[]"
         data-preview-file-type="text" required>
  <script>
    console.log(photo_document);
    $("#photo_document").fileinput({'showUpload':false});
  </script>
</div>

我退回所有组件,一切都好。错误继续,图标仅出现。

   <script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>

    <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>

    <link href="../../../bower_components/bootstrap-fileinput/css/fileinput.min.css" rel="stylesheet" type="text/css" />
    <script src="../../../bower_components/bootstrap-fileinput/js/fileinput.min.js"></script>

0 个答案:

没有答案