摘要: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> <style type="text/css"> p { position:relative; line-height:1.4em; height:4.2em; o 阅读全文
posted @ 2018-05-24 10:06 LSunshine 阅读(148) 评论(1) 推荐(1) 编辑
摘要: html2canvas https://github.com/cburgmer/rasterizeHTML.js 阅读全文
posted @ 2018-05-07 14:57 LSunshine 阅读(143) 评论(0) 推荐(0) 编辑
摘要: https://developer.mozilla.org/zh-CN/docs/Web/JavaScript http://huziketang.com/books/react/ 阅读全文
posted @ 2017-08-28 15:01 LSunshine 阅读(120) 评论(0) 推荐(0) 编辑
摘要: 一、JSON.parse(用于从一个字符串中解析出json 对象)ps:单引号写在{}外,每个属性都必须双引号,否则会抛出异常 let str = '[{"field":"thedate","v1":"20170102"},{"field":"rev_type","v1":"大数据收入"},{"fi 阅读全文
posted @ 2017-08-10 17:47 LSunshine 阅读(12520) 评论(1) 推荐(1) 编辑
摘要: getDateAfter_n(days){ let date = new Date(); date.setDate(date.getDate() + days); let yearStr = date.getFullYear(); let monthStr = ("0"+(date.getMonth 阅读全文
posted @ 2017-08-04 17:48 LSunshine 阅读(345) 评论(0) 推荐(0) 编辑
摘要: var path = require('path'); var webpack = require('webpack'); var CopyWebpackPlugin = require('copy-webpack-plugin'); const ExtractTextPlugin = requir 阅读全文
posted @ 2017-07-28 17:42 LSunshine 阅读(132) 评论(0) 推荐(0) 编辑
摘要: gulp-babel 取消严格模式方法 gulp-babel 取消严格模式方法 最近项目决定用ES6语法重构,于是引入了gulp-babel去编译ES6。 问题来了,babel编译ES6会自动添加"use strict"在js文件的最前面,这就导致之前的项目文件很多都报错。 因为之前的代码都编写的比 阅读全文
posted @ 2017-07-27 15:11 LSunshine 阅读(1692) 评论(0) 推荐(0) 编辑
摘要: function gettimeLine(){ const now = new Date(); now.setHours( 0 ); now.setMinutes( 0 ); now.setSeconds( 1 ); const year = now.getFullYear(); const mon 阅读全文
posted @ 2017-07-21 18:16 LSunshine 阅读(136) 评论(0) 推荐(0) 编辑
摘要: const toJSON = ( ...args ) => ( item ) => { const result = {}; for( let i = 0; i < args.length; i ++ ){ result[ args[ i ] ] = item[ i ]; } return resu 阅读全文
posted @ 2017-07-21 12:04 LSunshine 阅读(152) 评论(0) 推荐(0) 编辑
摘要: this.state={ data:[] } this.setState({ data:datas(异步获取到的数据).map( item => Object.assign( {}, item ) ), }) 阅读全文
posted @ 2017-07-20 16:29 LSunshine 阅读(315) 评论(0) 推荐(0) 编辑