This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 爬虫: https://blog.csdn.net/qq_36612997/article/details/53036790 | |
// blog 作者: https://me.csdn.net/qq_36612997 | |
const questions = [ | |
{ | |
"id":"1", | |
"question":"三国演义是谁的著作", | |
"answer":"罗贯中" | |
}, | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function deepCopy(obj) { | |
if (typeof obj !== 'object' || obj === null) { | |
return obj | |
} | |
if (obj instanceof Date) { | |
return new Date(obj.getTime()) | |
} | |
if (obj instanceof Array) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Load plugins | |
var gulp = require('gulp'), | |
sass = require('gulp-ruby-sass'), | |
autoprefixer = require('gulp-autoprefixer'), | |
minifycss = require('gulp-minify-css'), | |
jshint = require('gulp-jshint'), | |
uglify = require('gulp-uglify'), | |
imagemin = require('gulp-imagemin'), | |
rename = require('gulp-rename'), | |
clean = require('gulp-clean'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(() => { | |
['white', 'silver', 'gray', 'black', 'red', 'maroon', 'yellow', 'olive', 'lime', | |
'green', 'aqua', 'teal', 'blue', 'navy', 'fuchsia', 'purple' | |
].forEach(color => { | |
console[color] = (...args) => { | |
console.log(`%c${args.join(' ')}`, `color:${color}`) | |
} | |
console[`${color}B`] = (...args) => { | |
console.log(`%c${args.join(' ')}`, `color:${color};font-weight:bold`) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// connect() is a function that injects Redux-related props into your component. | |
// You can inject data and callbacks that change that data by dispatching actions. | |
function connect(mapStateToProps, mapDispatchToProps) { | |
// It lets us inject component as the last step so people can use it as a decorator. | |
// Generally you don't need to worry about it. | |
return function (WrappedComponent) { | |
// It returns a component | |
return class extends React.Component { | |
render() { | |
return ( |