就是通过官方示例来的

地址:https://examples.bootstrap-table.com/#extensions/fixed-columns.html

使用固定属性

data-fixed="true"
data-fixed-columns="true"
data-fixed-number="2"
data-fixed-right-number="1"

引入扩展

<script src="<!--{$basePath}-->views/js/bootstrap-table/extensions/sticky-header/bootstrap-table-sticky-header.js"></script>
<script src="<!--{$basePath}-->views/js/bootstrap-table/extensions/fixed-columns/bootstrap-table-fixed-columns.js?v=1.3" type="text/javascript"></script>

我犯错在没有引入CSS,这个固定列有专用的CSS,所以导致固定列以后,会出现重复行,折腾了好久,最后发现是没有引入CSS

引入如下CSS

<link rel="stylesheet" href="<!--{$basePath}-->views/js/bootstrap-table/extensions/sticky-header/bootstrap-table-sticky-header.css">
  <link rel="stylesheet" href="<!--{$basePath}-->views/js/bootstrap-table/extensions/fixed-columns/bootstrap-table-fixed-columns.css">

然后就正常了。