koala-coding / day-day-up

每天进步一点点,记录每天在公司的一个小收获,一年后你回顾肯定收获了很多,哪怕是你知道了一个新函数,甚至一个新单词都可以。也算是一个个人成长秘籍吧
Apache License 2.0
9 stars 0 forks source link

2019年12月19日你要记录点什么? #14

Open weblixin opened 4 years ago

weblixin commented 4 years ago

ES6 Set 和 Map

Set的结构是类似于数组结构,但是成员都是不重复的值(对象除外)

Map结构是键值对集合(Hash结构)

592837154 commented 4 years ago

前端静态服务

fe.sh

#!/bin/bash
cd /root/20191219/20191219-fe/
git checkout master
git pull
rm -rf /usr/shar/nginx/build
cp -r /root/20191219/20191219-fe/build/ /usr/share/nginx/
systemctl restart nginx.service

nginx.conf

server {
    root         /usr/share/nginx/build/;
}

package.json

{
  "name": "zhukai-fe",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@testing-library/jest-dom": "^4.2.4",
    "@testing-library/react": "^9.3.2",
    "@testing-library/user-event": "^7.1.2",
    "@types/jest": "^24.0.0",
    "@types/node": "^12.0.0",
    "@types/react": "^16.9.0",
    "@types/react-dom": "^16.9.0",
    "antd": "^3.26.3",
    "babel-plugin-import": "^1.13.0",
    "customize-cra": "^0.9.1",
    "react": "^16.12.0",
    "react-app-rewired": "^2.1.5",
    "react-dom": "^16.12.0",
    "react-scripts": "3.3.0",
    "typescript": "~3.7.2"
  },
  "scripts": {
    "start": "react-app-rewired start",
    "build": "react-app-rewired build",
    "test": "react-app-rewired test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": "react-app"
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  }
}

项目目录

├── README.md
├── build
├── node_modules
├── package.json
├── public
├── src
    ├── App.css
    ├── App.js
    ├── App.test.js
    ├── index.css
    ├── index.js
    ├── logo.svg
    ├── serviceWorker.js
    └── setupTests.js
└── yarn.lock

前端依赖

yarn create react-app 20191219 --template typescript
yarn add antd
yarn add react-app-rewired customize-cra
yarn add babel-plugin-import

fe开发流程

  1. 拉代码, 开发
  2. 本地yarn build, git push
  3. ssh到服务器中
  4. 执行fe.sh
  5. 访问网站
fecym commented 4 years ago

今天360面试遇到一个很有趣的题,分享一下

关于函数的 length 属性  下面这道题题我答错了,因为我认为有 length 属性一般都是数组或者类数组对象,在者就是定义了 length 属性的对象,所以我认为下面的语句打印应该为 undefined,可是我忽略了 arguments 对象也是一个类数组对象,而函数的 length 属性指的就是函数的参数个数,也就是 arguments 的个数

(a => a).length   // 1
(() => 1).length  // 0
WYGL commented 4 years ago

焦点事件onblur在div盒子里面要加tabindex属性 获取信息事件getxxx, 获取到某一个地图图层,再往后会报错 vue传值兄弟属性传值区分绑定事件和绑定属性, vuex 存储数据 获取数据直接获取拿到vuex中的存储的值