02 2021 档案

摘要:下载并安装Redis,使用默认设置(Windows): https://github.com/tporadowski/redis/releases/download/v5.0.10/Redis-x64-5.0.10.msi 以管理员身份运行cmd 进入Redis安装目录: cd C:\Program 阅读全文
posted @ 2021-02-28 14:57 starlog 阅读(79) 评论(0) 推荐(0)
摘要:1.以管理员身份运行cmd(windows) 2.使用vscode打开host文件: code C:\Windows\System32\drivers\etc\hosts 3.进入以下网址: ipaddress.com 4.分别查找如下几个网址的IP: github.com assets-cdn.g 阅读全文
posted @ 2021-02-28 13:48 starlog 阅读(734) 评论(0) 推荐(1)
摘要:HTML: <div id="container"> <div id="child1">...</div> <div is="child2">...</div> </div> CSS: #container{ display: flex; flex-flow: column; } #child1{ 阅读全文
posted @ 2021-02-27 14:32 starlog 阅读(1170) 评论(0) 推荐(0)
摘要:以管理员身份运行cmd(Windows) cd C:\Program Files\MySQL\MySQL Server 8.0\bin mysql -uroot -proot ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_pas 阅读全文
posted @ 2021-02-23 21:29 starlog 阅读(55) 评论(0) 推荐(0)
摘要:下载MySQL(Windows): https://dev.mysql.com/get/Downloads/MySQLInstaller/mysql-installer-community-8.0.26.0.msi 安装MySQL: 使用开发默认配置,root密码设成自己能记住的,以后如果密码忘了就 阅读全文
posted @ 2021-02-22 21:23 starlog 阅读(86) 评论(0) 推荐(0)
摘要:在项目根目录有files文件夹和index.js,在files文件夹里有a.json、b.json、c.json三个文件,要按顺序获取它们的内容 index.js: const fs = require('fs') const path = require('path') // 按顺序获取文件内容 阅读全文
posted @ 2021-02-20 14:03 starlog 阅读(53) 评论(0) 推荐(0)
摘要:勾选要选中的文本,按 Ctrl + Shift + L ,然后编辑文本 阅读全文
posted @ 2021-02-19 14:07 starlog 阅读(300) 评论(0) 推荐(0)
摘要:在项目根目录: git config core.longpaths true 问题解决 阅读全文
posted @ 2021-02-19 13:25 starlog 阅读(401) 评论(0) 推荐(0)
摘要:过滤文件夹: node_modules/ 过滤文件: demo.html 过滤全部具有某种后缀名的文件: *.zip 跟踪文件夹: !src/ 跟踪文件: !index.html 跟踪全部具有某种后缀名的文件: !*.js 示例: .DS_Store node_modules/ dist/ npm- 阅读全文
posted @ 2021-02-19 12:26 starlog 阅读(567) 评论(0) 推荐(0)
摘要:在项目根目录启动cmd 新建.gitignore文件: type nul> .gitignore 使用vscode打开.gitignore文件 code .gitignore 输入以下内容并保存 node_modules/ 这样以后就不会提交node_modules文件夹了 删除本地仓库提交过的no 阅读全文
posted @ 2021-02-19 12:02 starlog 阅读(466) 评论(0) 推荐(0)
摘要:先在GitHub创建对应的仓库 在项目根目录配置.gitignore文件: Git提交代码时使用.gitignore过滤node_modules文件夹 Git使用.gitignore过滤文件的过滤规则 在项目根目录: git init git add . 或 git add * git commit 阅读全文
posted @ 2021-02-18 17:50 starlog 阅读(66) 评论(0) 推荐(0)
摘要:// 要删除非空文件夹,需要先把文件夹里的文件删除,再删除空文件夹 function removeDir(path) { let data = fs.readdirSync(path); //data是一个数组,文件夹名和文件名用引号括起来,如["1", "2.txt", "3.html"] for 阅读全文
posted @ 2021-02-18 14:23 starlog 阅读(658) 评论(0) 推荐(0)
摘要:安装nodemon: npm i nodemon -g 阅读全文
posted @ 2021-02-17 18:51 starlog 阅读(96) 评论(0) 推荐(0)
摘要:一、this调用的各种情况: 1.作为普通函数被调用(this引用Window对象) 2.使用call、apply、bind(传入什么,this就绑定什么) 3.作为对象方法被调用(this引用对象本身,谁调用就是谁) 4.在class方法中调用(this引用当前实例本身) 5.在箭头函数中被调用( 阅读全文
posted @ 2021-02-15 22:58 starlog 阅读(304) 评论(0) 推荐(0)
摘要:<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="wi 阅读全文
posted @ 2021-02-15 14:27 starlog 阅读(123) 评论(0) 推荐(0)
摘要:<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="wi 阅读全文
posted @ 2021-02-15 14:05 starlog 阅读(31) 评论(0) 推荐(0)
摘要:<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="wi 阅读全文
posted @ 2021-02-15 14:01 starlog 阅读(38) 评论(0) 推荐(0)
摘要:<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="wi 阅读全文
posted @ 2021-02-15 13:35 starlog 阅读(53) 评论(0) 推荐(0)
摘要:<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="wi 阅读全文
posted @ 2021-02-15 11:43 starlog 阅读(129) 评论(0) 推荐(0)
摘要:完整版: function deepCopy(obj, cache = new WeakMap()) { // 支持值类型 // 与值类型相对的是对象类型,对象是指内存中的可以被标识符引用的一块区域 if (!obj instanceof Object) return obj; // 防止循环引用 阅读全文
posted @ 2021-02-14 17:31 starlog 阅读(147) 评论(0) 推荐(0)
摘要:<html> <head></head> <body></body> <script> // foo是一个函数 function foo(name, age) { console.log(this); console.log(`姓名:${name},年龄:${age}`); } // obj是一个对 阅读全文
posted @ 2021-02-14 00:47 starlog 阅读(33) 评论(0) 推荐(0)
摘要:有一个对象: let obj = {name: 'Jack', age: 50}; ES6字符串拼接: let str_es6 = `姓名是:${obj.name}, 年龄是:${obj.age}`;// 打印结果:// 姓名是:Jack, 年龄是:50 ES5字符串拼接: let str_es5 阅读全文
posted @ 2021-02-13 23:40 starlog 阅读(89) 评论(0) 推荐(0)
摘要:生成根据长度截取的新字符串:substr /** * @param start 子字符串的起始下标 * @param count 子字符串的长度 * @return 新的字符串 */ String.substr(start, count) // 例子 let str = 'what are you 阅读全文
posted @ 2021-02-13 12:53 starlog 阅读(84) 评论(0) 推荐(0)
摘要:对数组的每个元素都执行一次回调函数:forEach 通过指定函数处理数组的每个元素,并返回处理后的数组:map 检测数值元素,并返回符合条件所有元素的数组:filter 将数组元素计算为一个值(从左到右):reduce 返回符合条件的数组元素:find 检测数值元素的每个元素是否都符合条件:ever 阅读全文
posted @ 2021-02-10 11:34 starlog 阅读(88) 评论(0) 推荐(0)
摘要:双飞翼布局: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta 阅读全文
posted @ 2021-02-10 11:22 starlog 阅读(76) 评论(0) 推荐(0)
摘要:JavaScript中每个对象都有一个_proto_属性指向这个对象构造函数的prototype对象,构造函数的prototype对象也有一个_proto_属性指向上层构造函数的prototype对象,最终指向null,形成原型链。 在JavaScript中,当试图访问一个对象的属性时,它不仅仅在该 阅读全文
posted @ 2021-02-09 21:54 starlog 阅读(144) 评论(0) 推荐(0)
摘要:安装cnpm: npm install -g cnpm --registry=https://registry.npm.taobao.org 安装删除工具: cnpm install rimraf -g 切换到项目目录: cd D:\Projects\my_app 使用命令删除node_module 阅读全文
posted @ 2021-02-07 21:07 starlog 阅读(347) 评论(0) 推荐(0)
摘要:切换npm源为镜像源: npm config set registry https://registry.npmmirror.com 切换yarn源为镜像源: yarn config set registry https://registry.npmmirror.com 切换npm源为默认源: np 阅读全文
posted @ 2021-02-07 19:32 starlog 阅读(458) 评论(0) 推荐(0)
摘要:进入nvm安装目录: cd C:\Users\lenovo\AppData\Roaming\nvm 输入以下命令,然后输入y: RD /S v15.8.0 阅读全文
posted @ 2021-02-07 15:59 starlog 阅读(1471) 评论(0) 推荐(0)
摘要:使用nvm安装node: https://www.cnblogs.com/starlog/p/14384773.html 切换npm源为淘宝源: npm config set registry https://registry.npm.taobao.org 安装nrm: npm install -g 阅读全文
posted @ 2021-02-07 15:25 starlog 阅读(329) 评论(0) 推荐(0)
摘要:一、打开命令行工具 二、使用nvm安装node: https://www.cnblogs.com/starlog/p/14384773.html 三、运行以下命令,分别安装cnpm、yarn、tyarn: npm i -g cnpm yarn tyarn --registry=https://reg 阅读全文
posted @ 2021-02-07 14:29 starlog 阅读(4325) 评论(0) 推荐(0)
摘要:一、进入nvm下载页面(Windows): https://github.com/coreybutler/nvm-windows/releases 如果打不开GitHub,可以尝试修改host文件: https://www.cnblogs.com/starlog/p/14458834.html 二、 阅读全文
posted @ 2021-02-07 13:39 starlog 阅读(16079) 评论(0) 推荐(0)
摘要:用类: import React from 'react'; import { IonIcon, addIcons } from 'react-svg-ionicons'; import bundle from 'react-svg-ionicons/bundles/all'; import Pro 阅读全文
posted @ 2021-02-04 23:34 starlog 阅读(106) 评论(0) 推荐(0)
摘要:在组件中: import PropTypes from 'prop-types'; const { items, onModifyItem, onDeleteItem } = props 这是传入组件的属性 PriceList.propTypes = { items: PropTypes.array 阅读全文
posted @ 2021-02-04 23:08 starlog 阅读(173) 评论(0) 推荐(0)
摘要:在项目根目录: npm i react-svg-ionicons -S 在组件中: import { IonIcon, addIcons } from 'react-svg-ionicons'; import bundle from 'react-svg-ionicons/bundles/all'; 阅读全文
posted @ 2021-02-04 20:49 starlog 阅读(203) 评论(0) 推荐(0)
摘要:在项目根目录: npm install bootstrap --save 在index.js: import 'bootstrap/dist/css/bootstrap.min.css' 选择、调整样式: https://v4.bootcss.com/docs/components/alerts/ 阅读全文
posted @ 2021-02-04 16:35 starlog 阅读(703) 评论(0) 推荐(0)
摘要:方法1: import React from 'react'; import './CommentList.css' class CommentList extends React.Component { constructor(props) { super(props) } handleDelet 阅读全文
posted @ 2021-02-03 17:29 starlog 阅读(670) 评论(0) 推荐(0)
摘要:import React from 'react' class App extends React.Component { render() { const boss = '李云龙' return ( <div> <h2>独立团团长,{boss}</h2> <Battalion1 boss='张大喵 阅读全文
posted @ 2021-02-03 17:27 starlog 阅读(177) 评论(0) 推荐(0)
摘要:html { font-size: 20px; } label { width: 5rem; height: 2rem; display: block; margin: 0 auto; line-height: 2rem; text-align: center; } 阅读全文
posted @ 2021-02-03 17:14 starlog 阅读(1095) 评论(0) 推荐(0)