试试这个:如果你添加 onfocus="blur();"这个元素不会让软键盘打开。因此,您不会在移动设备上打开键盘。
$('#sandbox-container input').datepicker({});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://unpkg.com/[email protected]/dist/js/bootstrap-datepicker.min.js"></script>
<link href="https://netdna.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" rel="stylesheet"/>
<link href="https://unpkg.com/[email protected]/dist/css/bootstrap-datepicker3.min.css" rel="stylesheet"/>
<div id="sandbox-container"><input type="text" class="form-control" onfocus="blur();"></div>