- 博客(6)
- 收藏
- 关注
原创 React: Whitespace text nodes cannot appear as a child of <tr>. Make sure....警告的解决办法
初学React碰到这个问题,虽然页面能正常显示,但是这红色警告看着真的让人不舒服。找了很久终于发现了问题出在哪里错误代码如下:class MyTable extends React.Component{ constructor(props){ super(props); this.state = {}...
2019-08-19 20:20:54
4861
原创 ES6中对数组的扩展
1.扩展运算符可以将一个数组转为参数序列let arr = [1,2,3,4,true,null,undefined];console.log(...arr); //1 2 3 4 true null undefinedconsole.log(...[1,2,3,4]); //1 2 3 42.Array.from可以将类数组对象或是可遍历的interable对象转为数组,包括ES...
2019-08-15 11:33:35
137
原创 JavaScript中的every(),some(),filter()和map()
every(),some(),filter(),map()都是Array对象的方法语法: array.every(function(value,index,arr),thisValue)它们都有两个参数每一项上运行的函数,必填function(value,index,arr) value表示当前元素的值,必填 index表示当前元素的索引,选填 arr表示当前元素所属于的数组对象...
2019-07-16 19:13:30
166
原创 CSS让子元素快速水平垂直居中的几种方法
方法有很多这里列出几种常用的CSS代码如下 父元素类名以out打头,子元素类名以in打头 one,two…代表不同的方法<style> *{ padding: 0; margin: 0; } [class*=out]{ width: 200px; height: 200px; background-color: pink; margin: 20px;...
2019-07-02 20:57:07
396
原创 JavaScript-js中数组与字符串之间的转换
/*将数组转化为字符串*/ // 用法 数组名.join(符号) var txt = ["aa","bb","cc"]; console.log(txt.join("-")); //结果为 aa-bb-cc 的字符串 而不是数组 console.log(txt.join("*")); //aa*bb*cc字符串 console.log(txt); ...
2019-04-15 16:47:44
112
原创 javascript-Cannot read property 'style' of null的解决办法
调用的object为空,查看getElementById()或getElementsByTagName()等中的值是否正确;想获取的属性还未加载出来,将js代码写在 window.onload = function () { }中;存在重复的id;...
2019-04-15 16:02:55
9435
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人