2018年9月25日

校验字符串是否json格式

摘要: //判断是否JSON格式 function isJSON(str) { if (typeof str == 'string') { try { var obj=JSON.parse(str); if(typeof obj == 'object' && obj ){ return true; ... 阅读全文

posted @ 2018-09-25 14:09 onlystrive 阅读(573) 评论(0) 推荐(0) 编辑

2018年7月25日

node汉字拼音转换需要用到pinyin包,使用pinyin中的分词时报错提示需要安装nodejieba依赖

摘要: 1、使用pinyin中的分词时报错提示需要安装nodejieba依赖; 2、安装 npm install -g nodejieba 报错 解决方案如下: 1、安装 npm install -g node-gyp 2、安装 npm install --global --production windo 阅读全文

posted @ 2018-07-25 10:00 onlystrive 阅读(1024) 评论(0) 推荐(0) 编辑

2018年6月22日

qrcodejs实现二维码动态生成

摘要: 测试代码: 测试结果: 参考资料: https://github.com/davidshimjs/qrcodejs 作者:onlystrive 出处:http://www.cnblogs.com/zyuc/ 本文版权归作者所有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连 阅读全文

posted @ 2018-06-22 13:51 onlystrive 阅读(1035) 评论(0) 推荐(0) 编辑

2018年6月20日

thinkjs2.x 配置 art-template 模板引擎

摘要: 一、thinkjs2.x默认模板引擎用的是ejs,改用art-template,art-template 是一个简约、超快的模板引擎(https://aui.github.io/art-template/zh-cn/docs/)。 二、切换到项目更目录安装art-template依赖: 安装命令:n 阅读全文

posted @ 2018-06-20 11:32 onlystrive 阅读(260) 评论(0) 推荐(0) 编辑

2017年11月24日

js正则匹配出所有图片及图片url

摘要: var a = '<P> <img src="40.jpg" > <img src="455.jpg" ></P>'; var regex = new RegExp(/<img src="([^"]*?)" >/g); var s = a.match(regex); console.log(s); 阅读全文

posted @ 2017-11-24 10:12 onlystrive 阅读(2232) 评论(0) 推荐(0) 编辑

2017年10月23日

数字添加千位分隔符

摘要: /** * 数字添加千位分隔符 * 使用:testFun(180000.22); * return 180,000.22; */let number={};number.testFun=function (num) { var source = String(num).split(".");//按小 阅读全文

posted @ 2017-10-23 18:02 onlystrive 阅读(262) 评论(0) 推荐(0) 编辑

win10 VS模拟器配置

摘要: 1、vs模拟器下载地址https://aka.ms/vscomemudownload(下载后安装) 2、启用Windows功能(Hyper-V) 3、打开vs模拟器 4、打开Hyper-V模拟器 需要给模拟器分配独立IP并绑定mac,在此修改mac地址。 5、启动模拟器 6、连接WLAN 注意:这里 阅读全文

posted @ 2017-10-23 16:57 onlystrive 阅读(1226) 评论(0) 推荐(0) 编辑

React native搭建项目

摘要: 创建项目 react-native init demo1 安装依赖包 npm i 启动服务器 react-native start 等一段时间,用浏览器访问 http://localhost:8081/index.android.bundle?platform=android 可以访问,即启动完成, 阅读全文

posted @ 2017-10-23 16:29 onlystrive 阅读(203) 评论(0) 推荐(0) 编辑

React native搭建环境

摘要: 安装JDK 1)下载地址 http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html 2)安装JDK 3) 配置环境变量 1、系统变量→新建 JAVA_HOME 变量 ,变量值填写jdk的安装 阅读全文

posted @ 2017-10-23 15:24 onlystrive 阅读(405) 评论(0) 推荐(0) 编辑

导航