-----------------------------------日常记录--------------------------------
1、初始化 select 的样子 如下:
2、重置后的效果如下:
3、重置的 js 代码如下:
$("#selectJumpStep").select2({ templateResult: formatState, templateSelection: formatState, width:"100%" }) function formatState(state){ var $state = $( '<span>' + state.text+ " - " + state.id + '</span>' ); return $state; }
4、相关 select2 的文档:
http://select2.github.io/select2/
https://select2.org/data-sources/formats
https://blog.csdn.net/tyjlearning/article/details/55100508
来源:https://www.cnblogs.com/zyfenblog/p/12402553.html