随笔分类 -  js+jq

摘要:数组是多维的, 查找最子级的 id 结果: [1, 3,1] 阅读全文
posted @ 2019-04-29 16:04 歲夢灬沉浮 阅读(4141) 评论(0) 推荐(0)
摘要:<style scoped>最近在开发中发现了修改elementUI样式的时候,添加了scoped的组件无法修改的样式,去掉scoped就可以了elementUI的样式是定义在全局中,我们使用scoped时,局部样式会被全局样式所覆盖(vue默认全局样式覆盖局部样式)。 阅读全文
posted @ 2019-02-15 10:11 歲夢灬沉浮
摘要:VUE的web app项目,需要实现某个部位吸顶的效果。即,页面往上滑动,刚好到达该部位时,该部分,固定在顶部显示。 1、监听滚动事件 利用VUE写一个在控制台打印当前的scrollTop, 首先,在mounted钩子中给window添加一个滚动滚动监听事件, 然后在方法中,添加这个handleSc 阅读全文
posted @ 2019-01-25 10:58 歲夢灬沉浮
摘要:一、vue的编译模式 (1)路由配置信息 (2)组件或第三方库 A、懒加载组件 B、同步加载组件 阅读全文
posted @ 2018-12-27 16:35 歲夢灬沉浮 阅读(1601) 评论(0) 推荐(0)
摘要:插槽分为单个插槽,具名插槽,还有作用域插槽,前两种比较简单这里就不赘述了,今天的重点是讨论作用域插槽。 简单来说,前两种插槽的内容和样式皆由父组件决定,也就是说显示什么内容和怎样显示都由父组件决定; 作用域插槽的样式由父组件决定,内容却由子组件控制。简单来说:前两种插槽不能绑定数据,作用域插槽是一个 阅读全文
posted @ 2018-12-27 14:21 歲夢灬沉浮 阅读(3902) 评论(0) 推荐(0)
摘要:inheritAttrs、attrs和attrs和listeners使用场景: 组件传值,尤其是祖孙组件有跨度的传值。 (1)inheritAttrs 属性说明:https://cn.vuejs.org/v2/api/#inheritAttrs 说明比较晦涩。 组件传值一般是通过props传值的。i 阅读全文
posted @ 2018-12-27 10:55 歲夢灬沉浮 阅读(748) 评论(0) 推荐(0)
摘要:var arr = [1,2,3,4]; console.log(arr.toString()); // 1,2,3,4 arr.toString()是将数组转化成字符串,因此不带 [ ] alert(JSON.stringify(arr)); console.log(JSON.stringify( 阅读全文
posted @ 2018-01-25 18:51 歲夢灬沉浮 阅读(1946) 评论(0) 推荐(0)
摘要:在A页添加 jq代码 B页 阅读全文
posted @ 2017-07-28 17:56 歲夢灬沉浮 阅读(7323) 评论(0) 推荐(1)
摘要:blur后替换 <input type="text" name="market_price" id="market_price" onblur="this.value=isNaN(this.value*1)?0:this.value*1" maxlength="10" value="<{if $de 阅读全文
posted @ 2017-01-11 17:23 歲夢灬沉浮 阅读(182) 评论(0) 推荐(0)
摘要:格式: obj.call(thisObj, arg1, arg2, ...); 参数为字符 obj.apply(thisObj, [arg1, arg2, ...]); 参数为数组 例一:sub函数赋值给this 例二: 点击把#content赋值给函数中的this来改变颜色和样式 hello 点击 阅读全文
posted @ 2016-11-21 12:02 歲夢灬沉浮
摘要:js弹窗&返回值(window.open方式) test.htm<html ><head> <title></title> <script type="text/javascript"> <!-- function winOpen() { window.open("test2.php","name1 阅读全文
posted @ 2016-09-22 14:37 歲夢灬沉浮
摘要:/**长字符串中插入换行符str:需要换行的字符串n:换行间隔字符数*/function insertEnter(str,n){ var len = str.length; var strTemp = ''; if(len > n){ strTemp = str.substring(0,n); st 阅读全文
posted @ 2016-07-28 10:59 歲夢灬沉浮
摘要:收集利用Jquery取得iframe中元素的几种方法 : $(document.getElementById('iframeId').contentWindow.document.body).htm() 显示iframe中body元素的内容。 $("#testId", document.frames 阅读全文
posted @ 2016-07-21 11:35 歲夢灬沉浮 阅读(245) 评论(0) 推荐(0)
摘要:法一: var data1 = "[{ value: '3017', label: '3017:有机磷农药,液体的,有毒的,易燃的'}, { value: '3018', label: '3018:有机磷农药,液体的,有毒的'}]";json1 = eval("(" + data1 + ")"); 阅读全文
posted @ 2016-07-14 19:22 歲夢灬沉浮 阅读(140) 评论(0) 推荐(0)
摘要:转:http://vote.wucheshuedu.com/index.php?s=/Home/Article/detail/id/35.html 阅读全文
posted @ 2016-07-13 10:43 歲夢灬沉浮