vant input输入框怎么弹出数字框
1、需要引入的js文件<script type="text/javascript" src="${ctx}/resources/js/jquery-1.9.1.min.js"></script><link rel="stylesheet" href="${ctx}/resources/ceShi/jquery-ui.css"&n
1、需要引入的js文件<script type="text/javascript" src="${ctx}/resources/js/jquery-1.9.1.min.js"></script><link rel="stylesheet" href="${ctx}/resources/ceShi/jquery-ui .css" type="text/css"></link><script type="text/javascript" src="${ctx}/resources/ceShi/jquery-ui.min.js">/script>
2、js代码<script type="text/javascript"> window.onload = function() { var availableTags = ${arr}; $( "#tags1" ).autocomplete({ source: availableTags });}
//生成数据的格式 //var availableTags = ["中国","AppleScript","Asp","BASIC" ];
</script>
<body> <div class="ui-widget"> <label for="tags">Tags:</label> <input id="tags1" /> </div></body>
3、后台代码 // 跳转到员工主界面 @RequestMapping("toList") public String toList(HttpServletRequest request) { String arrString= loginService.lenovoDate(); String[] arr=arrString.split(","); StringBuilder sBuilder=new StringBuilder(); sBuilder.append("["); for (int i = 0; i < arr.length; i++) { sBuilder.append("/""+arr[i]+"/","); } sBuilder.delete(sBuilder.length()-1, sBuilder.length()); sBuilder.append("]"); request.setAttribute("arr", sBuilder.toString()); return "/finance/post_list"; }
4、查询MySQL数据源的代码 <select id="lenovoDate" resultType="java.lang.String"> SELECT GROUP_CONCAT(r_name) AS arrName FROM role </select>
2024-07-18 广告