Bootstrap3 插件详解:赋予前端组件生命

版权申诉
0 下载量 139 浏览量 更新于2024-07-18 收藏 505KB PDF 举报
"这份前端学习资料专注于Bootstrap3插件的使用,包括Modal模态框、Collapse折叠、Carousel轮播图、Form validation表单验证、日期组件以及Bootstraptable和x-editable等常用项目。文档详细介绍了如何在项目中引入Bootstrap插件,强调了data属性API的使用以及纯JavaScript API的调用方法,并提供了模态框的实例代码。" Bootstrap3是流行的前端框架,它提供了一系列易于使用的组件和插件,帮助开发者快速构建响应式和移动优先的网站。这份资料详细讲解了如何利用这些工具提升用户体验。 1. **Bootstrap插件**:Bootstrap的核心JavaScript文件`bootstrap.min.js`包含了所有插件,引入这个文件后,开发者可以通过数据属性API或纯JavaScript API来激活和控制插件。数据属性API允许开发者在HTML元素上添加特定的data属性,无需编写JavaScript代码即可实现功能。要禁用data属性API,可以使用`$(document).off('.data-api')`。 2. **jQuery依赖**:在使用Bootstrap插件前,需要确保引入了jQuery库,因为Bootstrap插件依赖于jQuery。示例代码中展示了如何引入jQuery 3.1.0版本。 3. **Modal模态框**:Modal是一种弹出式的交互窗口,常用于显示详细信息或进行用户确认操作。文档提供了Modal的实例代码,包括触发模态框的按钮和模态框本身。`data-toggle="modal"`和`data-target="#myModal"`用于关联按钮和模态框,`data-dismiss="modal"`则用于关闭模态框。 4. **其他插件**: Collapse用于创建可折叠的内容区域,如导航菜单或 accordions;Carousel用于创建滑动展示多张图片或内容的轮播图;Form validation则提供了表单验证功能,确保用户输入的数据符合要求;日期组件可以帮助用户选择日期,提高输入体验。 5. **Bootstraptable和x-editable**:Bootstraptable是一个集成在Bootstrap中的表格插件,提供排序、搜索、分页等功能;x-editable则允许用户直接在页面上编辑文本,提升了数据编辑的便捷性。 这份资料对于正在学习Vue.js或其他前端技术,希望提升界面交互性的开发者来说非常有价值。通过学习和应用这些插件,开发者可以更高效地构建功能丰富的网页应用,同时保持Bootstrap的简洁和一致的样式。
2023-06-02 上传

vo类 public class ArealRainfallVo implements Serializable { private static final long serialVersionUID = 1L; @ApiModelProperty(value = "区域编码") private String code; @ApiModelProperty(value = "雨量总和") private BigDecimal value; } Mapper类 public interface WeightBetweenObjectAndRainfallStationMapper extends BaseMapper<WeightBetweenObjectAndRainfallStation> { List<ArealRainfallVo> ListbySumList (List<PointRainfallSumVO> list); } mapper配置类 <mapper namespace="com.ndwp.jboot.bootstrap.mapper.WeightBetweenObjectAndRainfallStationMapper"> <select id="ListbySumList" resultType="com.ndwp.jboot.bootstrap.entity.vo.ArealRainfallVo"> SELECT code, SUM(CASE <foreach collection="list" item = "item"> WHEN rainfall_station_code = '${item.getCode()}' THEN weight * ${item.getValue()} </foreach> END ) AS value FROM bootstrap.weight_between_object_and_rainfall_station GROUP BY code; </select> </mapper> 服务类 public interface IWeightBetweenObjectAndRainfallStationService extends BaseService<WeightBetweenObjectAndRainfallStation> { List<ArealRainfallVo> listAreaRainfall(Date start, Date end); } 服务实现类 @Service public class WeightBetweenObjectAndRainfallStationServiceImpl extends BaseServiceImpl<WeightBetweenObjectAndRainfallStationMapper, WeightBetweenObjectAndRainfallStation> implements IWeightBetweenObjectAndRainfallStationService { @Autowired IDataHistoricRainfallService dataHistoricRainfallService; @Override public List<ArealRainfallVo> listAreaRainfall(Date start, Date end) { List<PointRainfallSumVO> pointRainfallSumVOS = dataHistoricRainfallService.listAllPointRainfallByTime(start, end); return baseMapper.ListbySumList(pointRainfallSumVOS); } } 控制台打印的sql语句能够正常运行,结合代码分析一下为何会返回四个空对象?

2023-07-14 上传