今天使用 FormItem 组件时从 initialValue 中发现 "1,2,3"这样的字符串经过 split 操作后得到的结果是字符串数组。
const str = '1,2,3';
const arr = str.split(',');
console.log('arr', arr);
打印出来的结果是:
arr
(3) ["1", "2", "3"]
0: "1"
1: "2"
2: "3"
length: 3
那么如何把字符串数组转换成 number 数组呢
js 把字符串数组转换... 阅读全文
先看看 react blog, 看官方怎么说的
In React blog post:
URLs starting with javascript: are a dangerous attack surface because it’s easy to accidentally include unsanitized output in a tag like <a href> and create a security hole.
In React 16.9, this pattern ... 阅读全文
我的使用场景:
软路由(10.10.10.1)作为家里的中心网络服务器和网关设备,本地搭建了很多服务,很多服务需要输入 host 时,如果不做 dns 域名解析,那么每次都要输入 10.10.10.1 这一串很长的字符串,很麻烦。若是在局域网中的每台机器上 各自配置 hosts 文件那也很麻烦。所以就萌生了在软路由上使用 DNSmasq 来作为本地的唯一 dns 域名解析服务的想法。而且,k2p 作为 ap 接入的路由器,在配置了 dns 地址是 10.10.10.1 后也可以实现任何接入的终端... 阅读全文
k2p的荒野无灯老毛子固件使用AP模式时,必须定义LAN网中的DNS,否则k2p本身无法上网,但是它发射出来的WiFi还是可以的~
设置方法有两种:
①编辑/etc/resolv.conf 在domain padavan的下一行添加「nameserver 10.10.10.1」即可。
[hardRouter /home/root]# cat /etc/resolv.conf
domain padavan
nameserver 10.10.10.1
②管理网页:http://10.10.10.2... 阅读全文
cat /proc/sys/kernel/random/uuid
about UUID from en dot wikipedia dot org introduction page
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer systems. The term globally unique identifier (GUID) is al... 阅读全文