随笔分类 -  前端编程

JavaScript语言及各种前端框架
摘要:html: <Button type="link" onClick={HandleSubmit} disabled={disableFlag}>{linkText}</Button> 变量定义: const [disableFlag, setDisable] = useState<boolean>( 阅读全文
posted @ 2022-06-28 13:11 Shapley 阅读(2161) 评论(0) 推荐(0) 编辑
摘要:在chrome开发者工具种的网络tab页面查看页面跳转前的请求记录,方法如下: 勾选:Preserve log,中文版为:保留日志,即可查看页面跳转前的请求记录: 参考:https://blog.csdn.net/David_bdqn/article/details/122627312 阅读全文
posted @ 2022-05-16 09:26 Shapley 阅读(3076) 评论(0) 推荐(0) 编辑
摘要:ES6获取对象数组某个属性最大值: this.cavityNums = Math.max.apply(null, res.data.map(item => item.cavityNum)) ES6获取对象数组某个属性最小值: this.cavityNums = Math.min.apply(null 阅读全文
posted @ 2021-12-21 11:19 Shapley 阅读(980) 评论(0) 推荐(0) 编辑
摘要:webpack是一个前端打包工具,基于node.js开发的,使用时需要有node.js组件支持。 npm是一个包管理工具,例如:如果我们想安装某一个组件,可以使用命令:npm install ***,这个工具是node.js里面自带的。所以如果想使用这个工具,也需要node.js node.js是一 阅读全文
posted @ 2021-08-31 14:51 Shapley 阅读(280) 评论(0) 推荐(0) 编辑
摘要:1.本机需要安装node.js、webpack等 2.下载iview admin项目,当然也可以是其他的vue.js项目 3.运行调试过程: 首先打开iview admin项目所在目录,打开命令行窗口,切换到项目所在目录,然后运行命令: npm install 这个命令会安装项目所需的组件。 安装完 阅读全文
posted @ 2020-12-19 22:34 Shapley 阅读(1370) 评论(0) 推荐(0) 编辑
摘要:实例代码: actions: { // 获取用户信息 getUserInfo({commit}) { return new Promise((resolve, reject) => { getUserInfo().then(user => { if (user.data.success) { com 阅读全文
posted @ 2020-07-15 11:22 Shapley 阅读(2854) 评论(0) 推荐(0) 编辑
摘要:在html中根据list动态生成Button,点击每个按钮,改变自身的样式,代码如下: <ButtonGroup> <Button :type="buttonType[index]" v-for="(item,index) in yearList" :value="item.value" @clic 阅读全文
posted @ 2020-06-15 16:07 Shapley 阅读(1316) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2019-09-16 16:33 Shapley 阅读(137) 评论(0) 推荐(0) 编辑
摘要:function showView1() { var title = "查看"; layer.open({ title: title, type: 2, area: ['850px', '520px'], fixed: false, //不固定 maxmin: true, content: ctxP 阅读全文
posted @ 2019-09-06 14:36 Shapley 阅读(3379) 评论(0) 推荐(0) 编辑
摘要:<div class="control-group"> <label class="control-label">用户密码</label> <div class="controls"> <input type="password" class="span3 disabled" id="pwd" pl 阅读全文
posted @ 2018-04-16 16:30 Shapley 阅读(817) 评论(0) 推荐(0) 编辑
摘要:有两个页面A、B。页面A调用页面B。B页面还通过异步加载方式包含一个javascipt(例如叫:ClassHeaderEvaluation.js)文件。问题场景:A页面通过异步请求方式请求B,并在B的ClassHeaderEvaluation.js文件加载完成后,调用ClassHeaderEvaluation.js中的方法,怎样实现?思路1:使用循环等待的方式实现,不再累述。思路2:在B页面中,添加一个隐藏控件,例如id为:ClassHeaderEvaluationloaddiv,修改页面B中的代码如下:至此,页面A在加载页面B时,就可以在回调函数中对B页面中的控件ClassHeaderEva 阅读全文
posted @ 2013-12-13 16:51 Shapley 阅读(808) 评论(0) 推荐(1) 编辑
摘要:废话不说,直接上代码:$('#Teacherwin_details').window({ title: '查看教职工信息', width: 800, height: 520, top: ($(window).height() - 720) * 0.5, left: ($(window).width() - 800) * 0.5, modal: true, ... 阅读全文
posted @ 2013-11-26 15:14 Shapley 阅读(12135) 评论(0) 推荐(0) 编辑
摘要:收集了点JavaScript若干有意思的模式,在实际中很有用处:var ps = function(){alert("one");ps = function(){ alert("two");}}({ abc:function() { alert("haha"); } }.abc());({ abc:function() { alert("haha"); } }).abc(); 阅读全文
posted @ 2013-07-04 08:52 Shapley 阅读(104) 评论(0) 推荐(0) 编辑
摘要:做网站,难免会遇到客户要求切换网站的色系。虽然这不是一个很偏的要求,可是自己从来没有做过这方面的东西。最近,自己做一网站时就遇到了这样的需求,过程虽然顺利,但是还是想记录下来,供自己参考。说起来,色系切换和web聊天工具有异曲同工之妙。因为,无论使用何种技术实现了色系切换,最终的原理无非是着眼于控制端的选择:即让服务器端去完成这件事,还是让客户端完成这件事。联系到自己当前的实际情况。由于服务器端是购买的产品,无法做更多的操作,于是将色系切换的控制端放在了浏览器上。让浏览器通过记录用户的色系,从而加载不同的样式,从而达到切换色系的目的。想来也有点想笑,这样一来岂不是暗合了web通讯中“拉”的理念 阅读全文
posted @ 2012-12-26 16:08 Shapley 阅读(889) 评论(0) 推荐(0) 编辑
摘要:在本人最近制作的一个Demo中,需要在页面上实现时间倒计时功能。在参考网上一些现有代码的基础上,形成了一套兼容各种浏览器的时间倒计时代码。代码如下: 1 function DateDiff(startTime,latestTime) { 2 var aDate, oDate1, oDate2; 3 var ihours, imin, isec; 4 5 aDate = latestTime.split("-"); 6 oDate1 = new Date(aDate[1] + '-' + aDat... 阅读全文
posted @ 2012-03-31 21:08 Shapley 阅读(304) 评论(1) 推荐(0) 编辑
摘要:利用jQuery+jQuery UI实现了菜单左右滑动(显示与隐藏)的效果。代码引用:Jquery-latest.jsjquery.effects.core.jsjquery.effects.slide.jsjQuery.fn.extend({ slideRightShow:function(){ returnthis.each(function(){ $(this).show('slide',{direction:'right'},1000); }); }, slideLeftHide:function(){ returnthis.each(function( 阅读全文
posted @ 2012-03-26 11:00 Shapley 阅读(5681) 评论(0) 推荐(0) 编辑
摘要:"Message":"Error during serialization or deserialization using the JSON JavaScriptSerializer.The length of the string exceeds the value set on the max 阅读全文
posted @ 2010-12-28 19:38 Shapley 阅读(1563) 评论(0) 推荐(0) 编辑
摘要:毛坯版:代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->functionreload(){Sys.WebForms.PageRequestManager.getInstance().add_endRequest(InitPage);}functionInitPage(){varjson=getJson();vardata=eval('('+json+')');$('#<%=txtAudit.C 阅读全文
posted @ 2010-11-11 10:22 Shapley 阅读(497) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示